diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command new file mode 100644 index 0000000..04c85c0 --- /dev/null +++ b/.buildkite/hooks/pre-command @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# Export secrets for Docker containers. +# Restrict exposing secrets only to the steps that need them +export GCLOUD_SERVICE_KEY=$(gcloud secrets versions access latest --secret="GCLOUD_SERVICE_KEY" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_HOST" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_USER=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_USER" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_PASS" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_DBNAME" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_DBNAME" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_HOST" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_PASS" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_USER=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_USER" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_ACCOUNT=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ACCOUNT" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_DATABASE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_DATABASE" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_PASS" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_ROLE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ROLE" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_USER=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_USER" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_WAREHOUSE" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917") \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..526c516 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,59 @@ +steps: + - label: ":postgres: Run Tests - Postgres" + key: "run-dbt-postgres" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_POSTGRES_DBT_DBNAME" + - "CI_POSTGRES_DBT_HOST" + - "CI_POSTGRES_DBT_PASS" + - "CI_POSTGRES_DBT_USER" + commands: | + bash .buildkite/scripts/run_models.sh postgres + + - label: ":snowflake-db: Run Tests - Snowflake" + key: "run_dbt_snowflake" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_SNOWFLAKE_DBT_ACCOUNT" + - "CI_SNOWFLAKE_DBT_DATABASE" + - "CI_SNOWFLAKE_DBT_PASS" + - "CI_SNOWFLAKE_DBT_ROLE" + - "CI_SNOWFLAKE_DBT_USER" + - "CI_SNOWFLAKE_DBT_WAREHOUSE" + commands: | + bash .buildkite/scripts/run_models.sh snowflake + + - label: ":gcloud: Run Tests - BigQuery" + key: "run_dbt_bigquery" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "GCLOUD_SERVICE_KEY" + commands: | + bash .buildkite/scripts/run_models.sh bigquery + + - label: ":amazon-redshift: Run Tests - Redshift" + key: "run_dbt_redshift" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_REDSHIFT_DBT_DBNAME" + - "CI_REDSHIFT_DBT_HOST" + - "CI_REDSHIFT_DBT_PASS" + - "CI_REDSHIFT_DBT_USER" + commands: | + bash .buildkite/scripts/run_models.sh redshift diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh new file mode 100644 index 0000000..8e0a077 --- /dev/null +++ b/.buildkite/scripts/run_models.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +apt-get update +apt-get install libsasl2-dev + +python3 -m venv venv +. venv/bin/activate +pip install --upgrade pip setuptools +pip install -r integration_tests/requirements.txt +mkdir -p ~/.dbt +cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml + +db=$1 +echo `pwd` +cd integration_tests +dbt deps +dbt seed --target "$db" --full-refresh +dbt run --target "$db" --full-refresh +dbt test --target "$db" +dbt run --vars '{mailchimp_using_automations: false, mailchimp_using_segments: false}' --target "$db" --full-refresh +dbt test --target "$db" diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 149dc64..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: 2 - -jobs: - build: - docker: - - image: circleci/python:3.7.9-stretch - - steps: - - checkout - - - run: - run: setup_creds - command: | - echo $GCLOUD_SERVICE_KEY | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json - - run: - name: "Setup dbt" - command: | - sudo apt install libsasl2-dev - python3 -m venv venv - . venv/bin/activate - pip install --upgrade pip setuptools - pip install -r integration_tests/requirements.txt - mkdir -p ~/.dbt - cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml - - run: - name: "Run Tests - Redshift" - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target redshift --full-refresh - dbt run --vars '{mailchimp_using_automations: false, mailchimp_using_segments: false}' --target redshift --full-refresh - dbt run --target redshift --full-refresh - dbt test --target redshift - - run: - name: "Run Tests - Postgres" - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target postgres --full-refresh - dbt run --vars '{mailchimp_using_automations: false, mailchimp_using_segments: false}' --target postgres --full-refresh - dbt run --target postgres --full-refresh - dbt test --target postgres - - run: - name: "Run Tests - Snowflake" - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target snowflake --full-refresh - dbt run --vars '{mailchimp_using_automations: false, mailchimp_using_segments: false}' --target snowflake --full-refresh - dbt run --target snowflake --full-refresh - dbt test --target snowflake - - run: - name: "Run Tests - BigQuery" - environment: - GCLOUD_SERVICE_KEY_PATH: "/home/circleci/gcloud-service-key.json" - - command: | - . venv/bin/activate - echo `pwd` - cd integration_tests - dbt deps - dbt seed --target bigquery --full-refresh - dbt run --vars '{mailchimp_using_automations: false, mailchimp_using_segments: false}' --target bigquery --full-refresh - dbt run --target bigquery --full-refresh - dbt test --target bigquery - - save_cache: - key: deps2-{{ .Branch }} - paths: - - "venv" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 35f658d..50ee0df 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,3 @@ -Pull Request **Are you a current Fivetran customer?** @@ -29,9 +28,9 @@ Pull Request **How did you test the PR changes?** - + -- [ ] CircleCi +- [ ] Buildkite - [ ] Local (please provide additional testing details below) **Select which warehouse(s) were used to test the PR** diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e8506..7a57e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,45 @@ +# dbt_mailchimp_source v0.4.0 +[PR #12](https://github.com/fivetran/dbt_mailchimp_source/pull/12) includes the following breaking changes: +## 🚨 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: + - `any_value` + - `bool_or` + - `cast_bool_to_text` + - `concat` + - `date_trunc` + - `dateadd` + - `datediff` + - `escape_single_quotes` + - `except` + - `hash` + - `intersect` + - `last_day` + - `length` + - `listagg` + - `position` + - `replace` + - `right` + - `safe_cast` + - `split_part` + - `string_literal` + - `type_bigint` + - `type_float` + - `type_int` + - `type_numeric` + - `type_string` + - `type_timestamp` + - `array_append` + - `array_concat` + - `array_construct` +- For `current_timestamp` and `current_timestamp_in_utc` macros, the dispatch AND the macro names have been updated to the below, respectively: + - `dbt.current_timestamp_backcompat` + - `dbt.current_timestamp_in_utc_backcompat` +- `dbt_utils.surrogate_key` has also been updated to `dbt_utils.generate_surrogate_key`. Since the method for creating surrogate keys differ, we suggest all users do a `full-refresh` for the most accurate data. For more information, please refer to dbt-utils [release notes](https://github.com/dbt-labs/dbt-utils/releases) for this update. +- Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. +## 🎉 Documentation and Feature Updates 🎉: +- Updated README documentation for easier navigation and dbt package setup. +- Included the `mailchimp_[source_table_name]_identifier` variables for easier flexibility of the package models to refer to differently named sources tables. + # dbt_mailchimp_source v0.3.0 🎉 dbt v1.0.0 Compatibility 🎉 ## 🚨 Breaking Changes 🚨 diff --git a/README.md b/README.md index fbf1fc2..4d168af 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,78 @@ -[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -# Mailchimp (Source) +

+ + + + + + + + +

+ +# Mailchimp Source dbt Package ([Docs](https://fivetran.github.io/dbt_mailchimp_source/)) +# 📣 What does this dbt package do? +- Materializes [Mailchimp staging tables](https://fivetran.github.io/dbt_mailchimp_source/#!/overview/mailchimp_source/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/mailchimp/#schemainformation). These staging tables clean, test, and prepare your Mailchimp data from [Fivetran's connector](https://fivetran.com/docs/applications/mailchimp) 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 Mailchimp data through the [dbt docs site](https://fivetran.github.io/dbt_mailchimp_source/). +- These tables are designed to work simultaneously with our [Mailchimp transformation package](https://github.com/fivetran/dbt_mailchimp). + +# 🎯 How do I use the dbt package? +## Step 1: Prerequisites +To use this dbt package, you must have the following: +- At least one Fivetran Mailchimp connector syncing data into your destination. +- A **BigQuery**, **Snowflake**, **Redshift**, or **PostgreSQL** destination. + +## Step 2: Install the package +Include the following mailchimp_source package version in your `packages.yml` file. +> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. +```yml +packages: + - package: fivetran/mailchimp_source + version: [">=0.4.0", "<0.5.0"] +``` -This package models Mailchimp data from [Fivetran's connector](https://fivetran.com/docs/applications/mailchimp). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/mailchimp/#schemainformation). +## Step 3: Define database and schema variables +By default, this package runs using your destination and the `mailchimp` schema. If this is not where your Mailchimp data is (for example, if your Mailchimp schema is named `mailchimp_fivetran`), add the following configuration to your root `dbt_project.yml` file: -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 +```yml +vars: + mailchimp_database: your_database_name + mailchimp_schema: your_schema_name +``` -## Models -This package contains staging models, designed to work simultaneously with our [Mailchimp modeling package](https://github.com/fivetran/dbt_mailchimp). 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`. -- Foreign keys include the table that they refer to. For example, a campaign's `list` ID column is renamed `list_id`. +## Step 4: Disable models for non-existent sources +Your Mailchimp connector may not sync every table that this package expects. If your syncs exclude certain tables, it is because you either do not use that functionality in Mailchimp or actively excluded some tables from your syncs. To disable the corresponding functionality in the package, you must set the relevant config variables to `false`. By default, all variables are set to `true`. Alter variables for only the tables you want to disable: -## Installation Instructions -Add the following to your `packages.yml` file: ```yml -# packages.yml -packages: - - package: fivetran/mailchimp_source - version: [">=0.3.0", "<0.4.0"] +vars: + mailchip_using_automations: false #disable if you do not have the automation_email, automation_email, or automation_recipient_activity tables + mailchimp_using_segments: false #disable if you do not have the segment or segment_member table ``` -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. +## (Optional) Step 5: Additional configurations +
Expand to view configurations -## Configuration -By default, this package looks for your Mailchimp data in the `mailchimp` 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 Mailchimp data is, add the following configuration to your `dbt_project.yml` file: +### Changing the Build Schema +By default, this package builds the Mailchimp staging models within a schema titled (`` + `_stg_mailchimp`) in your destination. If this is not where you would like your Mailchimp staging data to be written to, add the following configuration to your root `dbt_project.yml` file: ```yml -# dbt_project.yml - -... -config-version: 2 +models: + mailchimp_source: + +schema: my_new_schema_name # leave blank for just the target_schema +``` +### Change the source table references +If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable: +> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_mailchimp_source/blob/main/dbt_project.yml) variable declarations to see the expected names. + +```yml vars: - mailchimp_database: your_database_name - mailchimp_schema: your_schema_name + mailchimp__identifier: your_table_name ``` - ### Passthrough Columns This package includes all of the source columns that are defined in the macros folder. We recommend including custom columns in this package because the staging models only bring in the standard columns for the `MEMBER` table. @@ -50,71 +82,44 @@ You can add more columns using our passthrough column variables. These variables Use the following format for declaring the respective passthrough variables (note to call the alias name, not original name, in the transform_sql): ```yml -# dbt_project.yml - vars: - mailchimp__members_pass_through_columns: - name: "custom_field_name" alias: "normal_field_name" transform_sql: "cast(normal_field_name as string)" ``` - - -### Disabling models - -It's possible that your Mailchimp connector does not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that functionality in Mailchimp or actively excluded some tables from your syncs. To disable the corresponding functionality in the package, you must add the relevant variables. By default, all variables are assumed to be `true`. Add variables for only the tables you would like to disable. The following source tables will be disabled if the vars is set to false: - -- automation -- automation_email -- automation_recipient -- automation_recipient_activity -- segment -- segment_member - +
+ +## (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™ +
Expand to view details +
+ +Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core™ setup guides](https://fivetran.com/docs/transformations/dbt#setupguide). +
+ +# 🔍 Does this package have dependencies? +This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site. +> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts. + ```yml -# dbt_project.yml - -... -config-version: 2 +packages: + - package: fivetran/fivetran_utils + version: [">=0.4.0", "<0.5.0"] -vars: - mailchip_using_automations: false #disable if you do not have the automation_email, automation_email, or automation_recipient_activity tables - mailchimp_using_segments: false #disable if you do not have the segment table + - package: dbt-labs/dbt_utils + version: [">=1.0.0", "<2.0.0"] ``` -### Changing the Build Schema -By default this package will build the Mailchimp staging models within a schema titled ( + `_stg_mailchimp`) in your target database. If this is not where you would like your Mailchimp staging data to be written to, add the following configuration to your `dbt_project.yml` file: +# 🙌 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/mailchimp_source/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_mailchimp_source/blob/main/CHANGELOG.md) and release notes for more information on changes across versions. -```yml -# dbt_project.yml - -... -models: - mailchimp_source: - +schema: my_new_schema_name # leave blank for just the target_schema -``` +## Contributions +A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions! -> Note that if your profile does not have permissions to create schemas in your warehouse, you can set the `+schema` to blank. The package will then write all tables to your pre-existing target schema. +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! -## Contributions -Additional contributions to this package are very welcome! Please create issues -or open PRs against `master`. Check out -[this post](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) -on the best workflow for contributing to a package. - -## Database Support -This package has been tested on BigQuery, Snowflake, Redshift, and Postgres. - -## Resources: -- Provide [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next -- Have questions or feedback, or need help? Book a time during our office hours [here](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_mailchimp_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 bbc2794..37f8cbe 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,15 +1,12 @@ name: 'mailchimp_source' -version: '0.3.0' - +version: '0.4.0' config-version: 2 - models: mailchimp_source: +materialized: table +schema: stg_mailchimp tmp: +materalized: view - vars: mailchimp_source: automation: "{{ source('mailchimp','automation') }}" @@ -27,4 +24,4 @@ vars: mailchimp__members_pass_through_columns: [] mailchimp_using_segments: true mailchimp_using_automations: true -require-dbt-version: [">=1.0.0", "<2.0.0"] +require-dbt-version: [">=1.3.0", "<2.0.0"] diff --git a/docs/catalog.json b/docs/catalog.json index a3c6acc..20c0d6c 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "0.20.2", "generated_at": "2021-10-22T16:07:01.900557Z", "invocation_id": "93fff409-e037-41f9-8d04-fe719ae3d15b", "env": {}}, "nodes": {"model.mailchimp_source.stg_mailchimp__segment_members": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segment_members", "database": "bigquery", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 108.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaigns", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "create_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "create_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "send_timestamp", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "reply_to_email": {"type": "STRING", "index": 6, "name": "reply_to_email", "comment": null}, "campaign_type": {"type": "STRING", "index": 7, "name": "campaign_type", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "archive_url": {"type": "STRING", "index": 9, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 10, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 11, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 12, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 13, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 14, "name": "content_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 15, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 16, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 17, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 18, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 19, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 20, "name": "inline_css", "comment": null}, "long_archive_url": {"type": "STRING", "index": 21, "name": "long_archive_url", "comment": null}, "status": {"type": "STRING", "index": 22, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 23, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 24, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 25, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 26, "name": "timewarp", "comment": null}, "to_name": {"type": "STRING", "index": 27, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 28, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 29, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 30, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 31, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 32, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "BOOL", "index": 33, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 34, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 35, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 36, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 37, "name": "winning_combination_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 309.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_emails_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "STRING", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "INT64", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "STRING", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "STRING", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 39, "name": "use_conversation", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__unsubscribes", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "unsubscribe_reason": {"type": "INT64", "index": 4, "name": "unsubscribe_reason", "comment": null}, "unsubscribe_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "unsubscribe_timestamp", "comment": null}, "unsubscribe_id": {"type": "STRING", "index": 6, "name": "unsubscribe_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 100.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaigns_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "STRING", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "STRING", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "STRING", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "INT64", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "STRING", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "STRING", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "BOOL", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 40, "name": "winning_combination_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 318.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_activities_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "STRING", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 9, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 783.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_activities", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "activity_id": {"type": "STRING", "index": 9, "name": "activity_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 965.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_activities", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action_type": {"type": "STRING", "index": 1, "name": "action_type", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "STRING", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "INT64", "index": 8, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 9, "name": "combination_id", "comment": null}, "activity_id": {"type": "STRING", "index": 10, "name": "activity_id", "comment": null}, "email_id": {"type": "STRING", "index": 11, "name": "email_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2739.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_recipients_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automations_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 9, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 11, "name": "trigger_settings", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_emails", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "automation_id": {"type": "STRING", "index": 2, "name": "automation_id", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 3, "name": "created_timestamp", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 4, "name": "started_timestamp", "comment": null}, "send_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "send_timestamp", "comment": null}, "from_name": {"type": "STRING", "index": 6, "name": "from_name", "comment": null}, "reply_to": {"type": "STRING", "index": 7, "name": "reply_to", "comment": null}, "status": {"type": "STRING", "index": 8, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 9, "name": "subject_line", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 11, "name": "to_name", "comment": null}, "archive_url": {"type": "STRING", "index": 12, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 13, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 14, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 15, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "INT64", "index": 16, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 17, "name": "content_type", "comment": null}, "delay_action": {"type": "STRING", "index": 18, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 19, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 20, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 21, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 22, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 23, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 24, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 25, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 26, "name": "folder_id", "comment": null}, "google_analytics": {"type": "STRING", "index": 27, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 28, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 29, "name": "position", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 32, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 33, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 34, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 35, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 36, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 37, "name": "use_conversation", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 343.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__lists_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "STRING", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "STRING", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 26, "name": "visibility", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 380.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__members_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "STRING", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "STRING", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "STRING", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "STRING", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "STRING", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "TIMESTAMP", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "FLOAT64", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "STRING", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "INT64", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "STRING", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "TIMESTAMP", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "TIMESTAMP", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "STRING", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 24, "name": "vip", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1841.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "INT64", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 660.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__unsubscribes_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "INT64", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 6, "name": "timestamp", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 74.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, "model.mailchimp_source.stg_mailchimp__segments": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segments", "database": "bigquery", "comment": null, "owner": null}, "columns": {"segment_id": {"type": "INT64", "index": 1, "name": "segment_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 3, "name": "member_count", "comment": null}, "segment_name": {"type": "STRING", "index": 4, "name": "segment_name", "comment": null}, "segment_type": {"type": "STRING", "index": 5, "name": "segment_type", "comment": null}, "updated_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "updated_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "created_timestamp", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 62.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, "model.mailchimp_source.stg_mailchimp__automations": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automations", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_id": {"type": "STRING", "index": 1, "name": "automation_id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 3, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 4, "name": "segment_text", "comment": null}, "started_timestamp": {"type": "TIMESTAMP", "index": 5, "name": "started_timestamp", "comment": null}, "created_timestamp": {"type": "TIMESTAMP", "index": 6, "name": "created_timestamp", "comment": null}, "status": {"type": "STRING", "index": 7, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 8, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 9, "name": "trigger_settings", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 287.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "combination_id": {"type": "INT64", "index": 3, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "email_id": {"type": "STRING", "index": 5, "name": "email_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 920.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segment_members_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 126.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, "model.mailchimp_source.stg_mailchimp__members": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__members", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "email_address": {"type": "STRING", "index": 2, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 3, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 4, "name": "email_type", "comment": null}, "status": {"type": "STRING", "index": 5, "name": "status", "comment": null}, "list_id": {"type": "STRING", "index": 6, "name": "list_id", "comment": null}, "signup_timestamp": {"type": "TIMESTAMP", "index": 7, "name": "signup_timestamp", "comment": null}, "opt_in_timestamp": {"type": "TIMESTAMP", "index": 8, "name": "opt_in_timestamp", "comment": null}, "last_changed_timestamp": {"type": "TIMESTAMP", "index": 9, "name": "last_changed_timestamp", "comment": null}, "country_code": {"type": "STRING", "index": 10, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 11, "name": "dstoff", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 12, "name": "gmtoff", "comment": null}, "opt_in_ip_address": {"type": "STRING", "index": 13, "name": "opt_in_ip_address", "comment": null}, "signup_ip_address": {"type": "STRING", "index": 14, "name": "signup_ip_address", "comment": null}, "language": {"type": "STRING", "index": 15, "name": "language", "comment": null}, "latitude": {"type": "FLOAT64", "index": 16, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 17, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 18, "name": "member_rating", "comment": null}, "timezone": {"type": "STRING", "index": 19, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 20, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 21, "name": "vip", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1741.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, "model.mailchimp_source.stg_mailchimp__lists": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__lists", "database": "bigquery", "comment": null, "owner": null}, "columns": {"list_id": {"type": "STRING", "index": 1, "name": "list_id", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 2, "name": "date_created", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 4, "name": "list_rating", "comment": null}, "beamer_address": {"type": "STRING", "index": 5, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 6, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 7, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 8, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 9, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 10, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 11, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 12, "name": "contact_zip", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 18, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 19, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 20, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 21, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 22, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 23, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 24, "name": "visibility", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 371.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__segments_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "type": {"type": "STRING", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 9, "name": "updated_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 71.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__campaign_activities_tmp", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "STRING", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 10, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1719.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"metadata": {"type": "table", "schema": "dbt_renee_stg_mailchimp", "name": "stg_mailchimp__automation_recipients", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "list_id": {"type": "STRING", "index": 3, "name": "list_id", "comment": null}, "automation_recipient_id": {"type": "STRING", "index": 4, "name": "automation_recipient_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 184.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "INT64", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 9, "name": "status", "comment": null}, "title": {"type": "STRING", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "STRING", "index": 11, "name": "trigger_settings", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation"}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign_recipient_activity", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "STRING", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "INT64", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "STRING", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 10, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1719.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity"}, "source.mailchimp_source.mailchimp.automation_recipient": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_recipient", "database": "bigquery", "comment": null, "owner": null}, "columns": {"automation_email_id": {"type": "STRING", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_recipient"}, "source.mailchimp_source.mailchimp.member": {"metadata": {"type": "table", "schema": "mailchimp", "name": "member", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "STRING", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "STRING", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "FLOAT64", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "STRING", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "STRING", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "STRING", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "FLOAT64", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "STRING", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "STRING", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "STRING", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "TIMESTAMP", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "FLOAT64", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "FLOAT64", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "INT64", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "STRING", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "INT64", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "STRING", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "TIMESTAMP", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "TIMESTAMP", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "STRING", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "STRING", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "BOOL", "index": 24, "name": "vip", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1841.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.member"}, "source.mailchimp_source.mailchimp.automation_email": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_email", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "STRING", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "INT64", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "STRING", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "STRING", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "INT64", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "INT64", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "STRING", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "STRING", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "INT64", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "STRING", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "TIMESTAMP", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "STRING", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "INT64", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "INT64", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "INT64", "index": 39, "name": "use_conversation", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 352.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_email"}, "source.mailchimp_source.mailchimp.campaign_recipient": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign_recipient", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "INT64", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 660.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient"}, "source.mailchimp_source.mailchimp.segment_member": {"metadata": {"type": "table", "schema": "mailchimp", "name": "segment_member", "database": "bigquery", "comment": null, "owner": null}, "columns": {"member_id": {"type": "STRING", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "INT64", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 2.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 126.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.segment_member"}, "source.mailchimp_source.mailchimp.segment": {"metadata": {"type": "table", "schema": "mailchimp", "name": "segment", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "STRING", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "INT64", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "STRING", "index": 7, "name": "name", "comment": null}, "type": {"type": "STRING", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 9, "name": "updated_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 71.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.segment"}, "source.mailchimp_source.mailchimp.campaign": {"metadata": {"type": "table", "schema": "mailchimp", "name": "campaign", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "STRING", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "BOOL", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "BOOL", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "BOOL", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "STRING", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "STRING", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "TIMESTAMP", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "BOOL", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "BOOL", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "INT64", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "STRING", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "STRING", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "BOOL", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "STRING", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "STRING", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "STRING", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "INT64", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "INT64", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "TIMESTAMP", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "STRING", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "STRING", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "INT64", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "INT64", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "BOOL", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "STRING", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "BOOL", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "BOOL", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "BOOL", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "BOOL", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "BOOL", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "STRING", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "BOOL", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "INT64", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "INT64", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "INT64", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "INT64", "index": 40, "name": "winning_combination_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 318.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.campaign"}, "source.mailchimp_source.mailchimp.unsubscribe": {"metadata": {"type": "table", "schema": "mailchimp", "name": "unsubscribe", "database": "bigquery", "comment": null, "owner": null}, "columns": {"campaign_id": {"type": "STRING", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "STRING", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "STRING", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "INT64", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 6, "name": "timestamp", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 74.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.unsubscribe"}, "source.mailchimp_source.mailchimp.list": {"metadata": {"type": "table", "schema": "mailchimp", "name": "list", "database": "bigquery", "comment": null, "owner": null}, "columns": {"id": {"type": "STRING", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "STRING", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "STRING", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "INT64", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "STRING", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "STRING", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "STRING", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "STRING", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "STRING", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "TIMESTAMP", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "STRING", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "STRING", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "STRING", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "INT64", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "BOOL", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "FLOAT64", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "STRING", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "INT64", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "INT64", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "STRING", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "STRING", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "STRING", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "BOOL", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "STRING", "index": 26, "name": "visibility", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 380.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.list"}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"metadata": {"type": "table", "schema": "mailchimp", "name": "automation_recipient_activity", "database": "bigquery", "comment": null, "owner": null}, "columns": {"action": {"type": "STRING", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "STRING", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "STRING", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "TIMESTAMP", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "INT64", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "STRING", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "STRING", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "STRING", "index": 9, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 7.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 783.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity"}}, "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-12-15T16:02:21.912529Z", "invocation_id": "ca9318cc-9843-47a5-8982-a6c7f5766aaf", "env": {}}, "nodes": {"seed.mailchimp_source_integration_tests.automation": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "integer", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "timestamp without time zone", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "text", "index": 9, "name": "status", "comment": null}, "title": {"type": "text", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "text", "index": 11, "name": "trigger_settings", "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.mailchimp_source_integration_tests.automation"}, "seed.mailchimp_source_integration_tests.automation_email": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation_email", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "text", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "text", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "integer", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "text", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "text", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "integer", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "integer", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "text", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "text", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "integer", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "text", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "timestamp without time zone", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "timestamp without time zone", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "text", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "integer", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "text", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "integer", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "integer", "index": 39, "name": "use_conversation", "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.mailchimp_source_integration_tests.automation_email"}, "seed.mailchimp_source_integration_tests.automation_recipient": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation_recipient", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"automation_email_id": {"type": "text", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_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.mailchimp_source_integration_tests.automation_recipient"}, "seed.mailchimp_source_integration_tests.automation_recipient_activity": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation_recipient_activity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action": {"type": "text", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "text", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "integer", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "text", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "text", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "text", "index": 9, "name": "url", "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.mailchimp_source_integration_tests.automation_recipient_activity"}, "seed.mailchimp_source_integration_tests.campaign": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "campaign", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "text", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "text", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "text", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "text", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "text", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "integer", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "timestamp without time zone", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "integer", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "boolean", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "text", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "boolean", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "integer", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "integer", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "integer", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "integer", "index": 40, "name": "winning_combination_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.mailchimp_source_integration_tests.campaign"}, "seed.mailchimp_source_integration_tests.campaign_recipient": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "campaign_recipient", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "integer", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_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.mailchimp_source_integration_tests.campaign_recipient"}, "seed.mailchimp_source_integration_tests.campaign_recipient_activity": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "campaign_recipient_activity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action": {"type": "text", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "integer", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "integer", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "text", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "text", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "text", "index": 10, "name": "url", "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.mailchimp_source_integration_tests.campaign_recipient_activity"}, "seed.mailchimp_source_integration_tests.list": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "list", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "text", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "text", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "integer", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "text", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "text", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "text", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "text", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "text", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "timestamp without time zone", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "text", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "text", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "text", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "integer", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "boolean", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "double precision", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "text", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "integer", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "integer", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "text", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "text", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "text", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "boolean", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "text", "index": 26, "name": "visibility", "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.mailchimp_source_integration_tests.list"}, "seed.mailchimp_source_integration_tests.member": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "member", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "text", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "double precision", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "text", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "text", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "text", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "double precision", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "text", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "text", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "text", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "timestamp without time zone", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "double precision", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "double precision", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "integer", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "text", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "integer", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "text", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "timestamp without time zone", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "timestamp without time zone", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "text", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "text", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "boolean", "index": 24, "name": "vip", "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.mailchimp_source_integration_tests.member"}, "seed.mailchimp_source_integration_tests.segment": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "segment", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "integer", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "type": {"type": "text", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 9, "name": "updated_at", "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.mailchimp_source_integration_tests.segment"}, "seed.mailchimp_source_integration_tests.segment_member": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "segment_member", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"member_id": {"type": "text", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "integer", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_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.mailchimp_source_integration_tests.segment_member"}, "seed.mailchimp_source_integration_tests.unsubscribe": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "unsubscribe", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "integer", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 6, "name": "timestamp", "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.mailchimp_source_integration_tests.unsubscribe"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automation_activities", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action_type": {"type": "text", "index": 1, "name": "action_type", "comment": null}, "automation_email_id": {"type": "text", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "timestamp without time zone", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "text", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "text", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "integer", "index": 8, "name": "bounce_type", "comment": null}, "activity_id": {"type": "text", "index": 9, "name": "activity_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.mailchimp_source.stg_mailchimp__automation_activities"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automation_activities_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action": {"type": "text", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "text", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "integer", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "text", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "text", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "text", "index": 9, "name": "url", "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.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automation_emails", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"automation_email_id": {"type": "text", "index": 1, "name": "automation_email_id", "comment": null}, "automation_id": {"type": "text", "index": 2, "name": "automation_id", "comment": null}, "created_timestamp": {"type": "timestamp without time zone", "index": 3, "name": "created_timestamp", "comment": null}, "started_timestamp": {"type": "timestamp without time zone", "index": 4, "name": "started_timestamp", "comment": null}, "send_timestamp": {"type": "timestamp without time zone", "index": 5, "name": "send_timestamp", "comment": null}, "from_name": {"type": "text", "index": 6, "name": "from_name", "comment": null}, "reply_to": {"type": "text", "index": 7, "name": "reply_to", "comment": null}, "status": {"type": "text", "index": 8, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 9, "name": "subject_line", "comment": null}, "title": {"type": "text", "index": 10, "name": "title", "comment": null}, "to_name": {"type": "integer", "index": 11, "name": "to_name", "comment": null}, "archive_url": {"type": "text", "index": 12, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 13, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 14, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 15, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "integer", "index": 16, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 17, "name": "content_type", "comment": null}, "delay_action": {"type": "text", "index": 18, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "text", "index": 19, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "integer", "index": 20, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "integer", "index": 21, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "text", "index": 22, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "text", "index": 23, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 24, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 25, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 26, "name": "folder_id", "comment": null}, "google_analytics": {"type": "text", "index": 27, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 28, "name": "inline_css", "comment": null}, "position": {"type": "integer", "index": 29, "name": "position", "comment": null}, "template_id": {"type": "integer", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "integer", "index": 31, "name": "timewarp", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 32, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 33, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 34, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 35, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 36, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "integer", "index": 37, "name": "use_conversation", "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.mailchimp_source.stg_mailchimp__automation_emails"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automation_emails_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "text", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "text", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "integer", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "text", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "text", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "integer", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "integer", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "text", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "text", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "integer", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "text", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "timestamp without time zone", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "timestamp without time zone", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "text", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "integer", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "text", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "integer", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "integer", "index": 39, "name": "use_conversation", "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.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automation_recipients", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"member_id": {"type": "text", "index": 1, "name": "member_id", "comment": null}, "automation_email_id": {"type": "text", "index": 2, "name": "automation_email_id", "comment": null}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": null}, "automation_recipient_id": {"type": "text", "index": 4, "name": "automation_recipient_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.mailchimp_source.stg_mailchimp__automation_recipients"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automation_recipients_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"automation_email_id": {"type": "text", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_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.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__automations": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automations", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"automation_id": {"type": "text", "index": 1, "name": "automation_id", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "segment_id": {"type": "integer", "index": 3, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 4, "name": "segment_text", "comment": null}, "started_timestamp": {"type": "timestamp without time zone", "index": 5, "name": "started_timestamp", "comment": null}, "created_timestamp": {"type": "timestamp without time zone", "index": 6, "name": "created_timestamp", "comment": null}, "status": {"type": "text", "index": 7, "name": "status", "comment": null}, "title": {"type": "text", "index": 8, "name": "title", "comment": null}, "trigger_settings": {"type": "text", "index": 9, "name": "trigger_settings", "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.mailchimp_source.stg_mailchimp__automations"}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__automations_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "integer", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "timestamp without time zone", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "text", "index": 9, "name": "status", "comment": null}, "title": {"type": "text", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "text", "index": 11, "name": "trigger_settings", "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.mailchimp_source.stg_mailchimp__automations_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__campaign_activities", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action_type": {"type": "text", "index": 1, "name": "action_type", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_id", "comment": null}, "activity_timestamp": {"type": "timestamp without time zone", "index": 5, "name": "activity_timestamp", "comment": null}, "ip_address": {"type": "text", "index": 6, "name": "ip_address", "comment": null}, "url": {"type": "text", "index": 7, "name": "url", "comment": null}, "bounce_type": {"type": "integer", "index": 8, "name": "bounce_type", "comment": null}, "combination_id": {"type": "integer", "index": 9, "name": "combination_id", "comment": null}, "activity_id": {"type": "text", "index": 10, "name": "activity_id", "comment": null}, "email_id": {"type": "text", "index": 11, "name": "email_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.mailchimp_source.stg_mailchimp__campaign_activities"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__campaign_activities_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action": {"type": "text", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "integer", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "integer", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "text", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "text", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "text", "index": 10, "name": "url", "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.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "combination_id": {"type": "integer", "index": 3, "name": "combination_id", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_id", "comment": null}, "email_id": {"type": "text", "index": 5, "name": "email_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.mailchimp_source.stg_mailchimp__campaign_recipients"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__campaign_recipients_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "integer", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_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.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__campaigns", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "segment_id": {"type": "integer", "index": 2, "name": "segment_id", "comment": null}, "create_timestamp": {"type": "timestamp without time zone", "index": 3, "name": "create_timestamp", "comment": null}, "send_timestamp": {"type": "timestamp without time zone", "index": 4, "name": "send_timestamp", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "reply_to_email": {"type": "text", "index": 6, "name": "reply_to_email", "comment": null}, "campaign_type": {"type": "text", "index": 7, "name": "campaign_type", "comment": null}, "title": {"type": "text", "index": 8, "name": "title", "comment": null}, "archive_url": {"type": "text", "index": 9, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 10, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 11, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 12, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "text", "index": 13, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 14, "name": "content_type", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 15, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 16, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 17, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 18, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 19, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 20, "name": "inline_css", "comment": null}, "long_archive_url": {"type": "text", "index": 21, "name": "long_archive_url", "comment": null}, "status": {"type": "text", "index": 22, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 23, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 24, "name": "template_id", "comment": null}, "test_size": {"type": "integer", "index": 25, "name": "test_size", "comment": null}, "timewarp": {"type": "boolean", "index": 26, "name": "timewarp", "comment": null}, "to_name": {"type": "text", "index": 27, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 28, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 29, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 30, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 31, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 32, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "boolean", "index": 33, "name": "use_conversation", "comment": null}, "wait_time": {"type": "integer", "index": 34, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "integer", "index": 35, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "integer", "index": 36, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "integer", "index": 37, "name": "winning_combination_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.mailchimp_source.stg_mailchimp__campaigns"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__campaigns_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "text", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "text", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "text", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "text", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "text", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "integer", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "timestamp without time zone", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "integer", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "boolean", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "text", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "boolean", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "integer", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "integer", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "integer", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "integer", "index": 40, "name": "winning_combination_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.mailchimp_source.stg_mailchimp__campaigns_tmp"}, "model.mailchimp_source.stg_mailchimp__lists": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__lists", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"list_id": {"type": "text", "index": 1, "name": "list_id", "comment": null}, "date_created": {"type": "timestamp without time zone", "index": 2, "name": "date_created", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "list_rating": {"type": "double precision", "index": 4, "name": "list_rating", "comment": null}, "beamer_address": {"type": "text", "index": 5, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "text", "index": 6, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "integer", "index": 7, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "text", "index": 8, "name": "contact_city", "comment": null}, "contact_company": {"type": "text", "index": 9, "name": "contact_company", "comment": null}, "contact_country": {"type": "text", "index": 10, "name": "contact_country", "comment": null}, "contact_state": {"type": "text", "index": 11, "name": "contact_state", "comment": null}, "contact_zip": {"type": "text", "index": 12, "name": "contact_zip", "comment": null}, "default_from_email": {"type": "text", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "text", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "text", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "integer", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "boolean", "index": 17, "name": "email_type_option", "comment": null}, "notify_on_subscribe": {"type": "integer", "index": 18, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "integer", "index": 19, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "text", "index": 20, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "text", "index": 21, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "text", "index": 22, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "boolean", "index": 23, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "text", "index": 24, "name": "visibility", "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.mailchimp_source.stg_mailchimp__lists"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__lists_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "text", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "text", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "integer", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "text", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "text", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "text", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "text", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "text", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "timestamp without time zone", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "text", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "text", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "text", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "integer", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "boolean", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "double precision", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "text", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "integer", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "integer", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "text", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "text", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "text", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "boolean", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "text", "index": 26, "name": "visibility", "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.mailchimp_source.stg_mailchimp__lists_tmp"}, "model.mailchimp_source.stg_mailchimp__members": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__members", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"member_id": {"type": "text", "index": 1, "name": "member_id", "comment": null}, "email_address": {"type": "text", "index": 2, "name": "email_address", "comment": null}, "email_client": {"type": "text", "index": 3, "name": "email_client", "comment": null}, "email_type": {"type": "text", "index": 4, "name": "email_type", "comment": null}, "status": {"type": "text", "index": 5, "name": "status", "comment": null}, "list_id": {"type": "text", "index": 6, "name": "list_id", "comment": null}, "signup_timestamp": {"type": "timestamp without time zone", "index": 7, "name": "signup_timestamp", "comment": null}, "opt_in_timestamp": {"type": "timestamp without time zone", "index": 8, "name": "opt_in_timestamp", "comment": null}, "last_changed_timestamp": {"type": "timestamp without time zone", "index": 9, "name": "last_changed_timestamp", "comment": null}, "country_code": {"type": "text", "index": 10, "name": "country_code", "comment": null}, "dstoff": {"type": "double precision", "index": 11, "name": "dstoff", "comment": null}, "gmtoff": {"type": "double precision", "index": 12, "name": "gmtoff", "comment": null}, "opt_in_ip_address": {"type": "text", "index": 13, "name": "opt_in_ip_address", "comment": null}, "signup_ip_address": {"type": "text", "index": 14, "name": "signup_ip_address", "comment": null}, "language": {"type": "text", "index": 15, "name": "language", "comment": null}, "latitude": {"type": "double precision", "index": 16, "name": "latitude", "comment": null}, "longitude": {"type": "double precision", "index": 17, "name": "longitude", "comment": null}, "member_rating": {"type": "integer", "index": 18, "name": "member_rating", "comment": null}, "timezone": {"type": "text", "index": 19, "name": "timezone", "comment": null}, "unique_email_id": {"type": "text", "index": 20, "name": "unique_email_id", "comment": null}, "vip": {"type": "boolean", "index": 21, "name": "vip", "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.mailchimp_source.stg_mailchimp__members"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__members_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "text", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "double precision", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "text", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "text", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "text", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "double precision", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "text", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "text", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "text", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "timestamp without time zone", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "double precision", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "double precision", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "integer", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "text", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "integer", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "text", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "timestamp without time zone", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "timestamp without time zone", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "text", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "text", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "boolean", "index": 24, "name": "vip", "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.mailchimp_source.stg_mailchimp__members_tmp"}, "model.mailchimp_source.stg_mailchimp__segment_members": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__segment_members", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"segment_id": {"type": "integer", "index": 1, "name": "segment_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "text", "index": 3, "name": "list_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.mailchimp_source.stg_mailchimp__segment_members"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__segment_members_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"member_id": {"type": "text", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "integer", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_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.mailchimp_source.stg_mailchimp__segment_members_tmp"}, "model.mailchimp_source.stg_mailchimp__segments": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__segments", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"segment_id": {"type": "integer", "index": 1, "name": "segment_id", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "member_count": {"type": "integer", "index": 3, "name": "member_count", "comment": null}, "segment_name": {"type": "text", "index": 4, "name": "segment_name", "comment": null}, "segment_type": {"type": "text", "index": 5, "name": "segment_type", "comment": null}, "updated_timestamp": {"type": "timestamp without time zone", "index": 6, "name": "updated_timestamp", "comment": null}, "created_timestamp": {"type": "timestamp without time zone", "index": 7, "name": "created_timestamp", "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.mailchimp_source.stg_mailchimp__segments"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__segments_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "integer", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "type": {"type": "text", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 9, "name": "updated_at", "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.mailchimp_source.stg_mailchimp__segments_tmp"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__unsubscribes", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": null}, "unsubscribe_reason": {"type": "integer", "index": 4, "name": "unsubscribe_reason", "comment": null}, "unsubscribe_timestamp": {"type": "timestamp without time zone", "index": 5, "name": "unsubscribe_timestamp", "comment": null}, "unsubscribe_id": {"type": "text", "index": 6, "name": "unsubscribe_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.mailchimp_source.stg_mailchimp__unsubscribes"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "name": "stg_mailchimp__unsubscribes_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "integer", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 6, "name": "timestamp", "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.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 4, "name": "create_time", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "segment_id": {"type": "integer", "index": 6, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 7, "name": "segment_text", "comment": null}, "start_time": {"type": "timestamp without time zone", "index": 8, "name": "start_time", "comment": null}, "status": {"type": "text", "index": 9, "name": "status", "comment": null}, "title": {"type": "text", "index": 10, "name": "title", "comment": null}, "trigger_settings": {"type": "text", "index": 11, "name": "trigger_settings", "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": "source.mailchimp_source.mailchimp.automation"}, "source.mailchimp_source.mailchimp.automation_email": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation_email", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "text", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 7, "name": "auto_tweet", "comment": null}, "automation_id": {"type": "text", "index": 8, "name": "automation_id", "comment": null}, "clicktale": {"type": "integer", "index": 9, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 10, "name": "content_type", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 11, "name": "create_time", "comment": null}, "delay_action": {"type": "text", "index": 12, "name": "delay_action", "comment": null}, "delay_action_description": {"type": "text", "index": 13, "name": "delay_action_description", "comment": null}, "delay_amount": {"type": "integer", "index": 14, "name": "delay_amount", "comment": null}, "delay_direction": {"type": "integer", "index": 15, "name": "delay_direction", "comment": null}, "delay_full_description": {"type": "text", "index": 16, "name": "delay_full_description", "comment": null}, "delay_type": {"type": "text", "index": 17, "name": "delay_type", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 18, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 19, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 20, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 21, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 22, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 23, "name": "inline_css", "comment": null}, "position": {"type": "integer", "index": 24, "name": "position", "comment": null}, "reply_to": {"type": "text", "index": 25, "name": "reply_to", "comment": null}, "send_time": {"type": "timestamp without time zone", "index": 26, "name": "send_time", "comment": null}, "start_time": {"type": "timestamp without time zone", "index": 27, "name": "start_time", "comment": null}, "status": {"type": "text", "index": 28, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 29, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 30, "name": "template_id", "comment": null}, "timewarp": {"type": "integer", "index": 31, "name": "timewarp", "comment": null}, "title": {"type": "text", "index": 32, "name": "title", "comment": null}, "to_name": {"type": "integer", "index": 33, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 34, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 35, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 36, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 37, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 38, "name": "track_text_clicks", "comment": null}, "use_conversation": {"type": "integer", "index": 39, "name": "use_conversation", "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": "source.mailchimp_source.mailchimp.automation_email"}, "source.mailchimp_source.mailchimp.automation_recipient": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation_recipient", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"automation_email_id": {"type": "text", "index": 1, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_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": "source.mailchimp_source.mailchimp.automation_recipient"}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "automation_recipient_activity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action": {"type": "text", "index": 1, "name": "action", "comment": null}, "automation_email_id": {"type": "text", "index": 2, "name": "automation_email_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "integer", "index": 6, "name": "bounce_type", "comment": null}, "ip": {"type": "text", "index": 7, "name": "ip", "comment": null}, "list_id": {"type": "text", "index": 8, "name": "list_id", "comment": null}, "url": {"type": "text", "index": 9, "name": "url", "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": "source.mailchimp_source.mailchimp.automation_recipient_activity"}, "source.mailchimp_source.mailchimp.campaign": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "campaign", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "archive_url": {"type": "text", "index": 4, "name": "archive_url", "comment": null}, "authenticate": {"type": "boolean", "index": 5, "name": "authenticate", "comment": null}, "auto_footer": {"type": "boolean", "index": 6, "name": "auto_footer", "comment": null}, "auto_tweet": {"type": "boolean", "index": 7, "name": "auto_tweet", "comment": null}, "clicktale": {"type": "text", "index": 8, "name": "clicktale", "comment": null}, "content_type": {"type": "text", "index": 9, "name": "content_type", "comment": null}, "create_time": {"type": "timestamp without time zone", "index": 10, "name": "create_time", "comment": null}, "drag_and_drop": {"type": "boolean", "index": 11, "name": "drag_and_drop", "comment": null}, "fb_comments": {"type": "boolean", "index": 12, "name": "fb_comments", "comment": null}, "folder_id": {"type": "integer", "index": 13, "name": "folder_id", "comment": null}, "from_name": {"type": "text", "index": 14, "name": "from_name", "comment": null}, "google_analytics": {"type": "text", "index": 15, "name": "google_analytics", "comment": null}, "inline_css": {"type": "boolean", "index": 16, "name": "inline_css", "comment": null}, "list_id": {"type": "text", "index": 17, "name": "list_id", "comment": null}, "long_archive_url": {"type": "text", "index": 18, "name": "long_archive_url", "comment": null}, "reply_to": {"type": "text", "index": 19, "name": "reply_to", "comment": null}, "segment_id": {"type": "integer", "index": 20, "name": "segment_id", "comment": null}, "segment_text": {"type": "integer", "index": 21, "name": "segment_text", "comment": null}, "send_time": {"type": "timestamp without time zone", "index": 22, "name": "send_time", "comment": null}, "status": {"type": "text", "index": 23, "name": "status", "comment": null}, "subject_line": {"type": "text", "index": 24, "name": "subject_line", "comment": null}, "template_id": {"type": "integer", "index": 25, "name": "template_id", "comment": null}, "test_size": {"type": "integer", "index": 26, "name": "test_size", "comment": null}, "timewarp": {"type": "boolean", "index": 27, "name": "timewarp", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "to_name": {"type": "text", "index": 29, "name": "to_name", "comment": null}, "track_ecomm_360": {"type": "boolean", "index": 30, "name": "track_ecomm_360", "comment": null}, "track_goals": {"type": "boolean", "index": 31, "name": "track_goals", "comment": null}, "track_html_clicks": {"type": "boolean", "index": 32, "name": "track_html_clicks", "comment": null}, "track_opens": {"type": "boolean", "index": 33, "name": "track_opens", "comment": null}, "track_text_clicks": {"type": "boolean", "index": 34, "name": "track_text_clicks", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "use_conversation": {"type": "boolean", "index": 36, "name": "use_conversation", "comment": null}, "wait_time": {"type": "integer", "index": 37, "name": "wait_time", "comment": null}, "winner_criteria": {"type": "integer", "index": 38, "name": "winner_criteria", "comment": null}, "winning_campaign_id": {"type": "integer", "index": 39, "name": "winning_campaign_id", "comment": null}, "winning_combination_id": {"type": "integer", "index": 40, "name": "winning_combination_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": "source.mailchimp_source.mailchimp.campaign"}, "source.mailchimp_source.mailchimp.campaign_recipient": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "campaign_recipient", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "combination_id": {"type": "integer", "index": 4, "name": "combination_id", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_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": "source.mailchimp_source.mailchimp.campaign_recipient"}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "campaign_recipient_activity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"action": {"type": "text", "index": 1, "name": "action", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 3, "name": "member_id", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 4, "name": "timestamp", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "bounce_type": {"type": "integer", "index": 6, "name": "bounce_type", "comment": null}, "combination_id": {"type": "integer", "index": 7, "name": "combination_id", "comment": null}, "ip": {"type": "text", "index": 8, "name": "ip", "comment": null}, "list_id": {"type": "text", "index": 9, "name": "list_id", "comment": null}, "url": {"type": "text", "index": 10, "name": "url", "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": "source.mailchimp_source.mailchimp.campaign_recipient_activity"}, "source.mailchimp_source.mailchimp.list": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "list", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "beamer_address": {"type": "text", "index": 4, "name": "beamer_address", "comment": null}, "contact_address_1": {"type": "text", "index": 5, "name": "contact_address_1", "comment": null}, "contact_address_2": {"type": "integer", "index": 6, "name": "contact_address_2", "comment": null}, "contact_city": {"type": "text", "index": 7, "name": "contact_city", "comment": null}, "contact_company": {"type": "text", "index": 8, "name": "contact_company", "comment": null}, "contact_country": {"type": "text", "index": 9, "name": "contact_country", "comment": null}, "contact_state": {"type": "text", "index": 10, "name": "contact_state", "comment": null}, "contact_zip": {"type": "text", "index": 11, "name": "contact_zip", "comment": null}, "date_created": {"type": "timestamp without time zone", "index": 12, "name": "date_created", "comment": null}, "default_from_email": {"type": "text", "index": 13, "name": "default_from_email", "comment": null}, "default_from_name": {"type": "text", "index": 14, "name": "default_from_name", "comment": null}, "default_language": {"type": "text", "index": 15, "name": "default_language", "comment": null}, "default_subject": {"type": "integer", "index": 16, "name": "default_subject", "comment": null}, "email_type_option": {"type": "boolean", "index": 17, "name": "email_type_option", "comment": null}, "list_rating": {"type": "double precision", "index": 18, "name": "list_rating", "comment": null}, "name": {"type": "text", "index": 19, "name": "name", "comment": null}, "notify_on_subscribe": {"type": "integer", "index": 20, "name": "notify_on_subscribe", "comment": null}, "notify_on_unsubscribe": {"type": "integer", "index": 21, "name": "notify_on_unsubscribe", "comment": null}, "permission_reminder": {"type": "text", "index": 22, "name": "permission_reminder", "comment": null}, "subscribe_url_long": {"type": "text", "index": 23, "name": "subscribe_url_long", "comment": null}, "subscribe_url_short": {"type": "text", "index": 24, "name": "subscribe_url_short", "comment": null}, "use_archive_bar": {"type": "boolean", "index": 25, "name": "use_archive_bar", "comment": null}, "visibility": {"type": "text", "index": 26, "name": "visibility", "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": "source.mailchimp_source.mailchimp.list"}, "source.mailchimp_source.mailchimp.member": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "member", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "country_code": {"type": "text", "index": 4, "name": "country_code", "comment": null}, "dstoff": {"type": "double precision", "index": 5, "name": "dstoff", "comment": null}, "email_address": {"type": "text", "index": 6, "name": "email_address", "comment": null}, "email_client": {"type": "text", "index": 7, "name": "email_client", "comment": null}, "email_type": {"type": "text", "index": 8, "name": "email_type", "comment": null}, "gmtoff": {"type": "double precision", "index": 9, "name": "gmtoff", "comment": null}, "ip_opt": {"type": "text", "index": 10, "name": "ip_opt", "comment": null}, "ip_signup": {"type": "text", "index": 11, "name": "ip_signup", "comment": null}, "language": {"type": "text", "index": 12, "name": "language", "comment": null}, "last_changed": {"type": "timestamp without time zone", "index": 13, "name": "last_changed", "comment": null}, "latitude": {"type": "double precision", "index": 14, "name": "latitude", "comment": null}, "longitude": {"type": "double precision", "index": 15, "name": "longitude", "comment": null}, "member_rating": {"type": "integer", "index": 16, "name": "member_rating", "comment": null}, "merge_fname": {"type": "text", "index": 17, "name": "merge_fname", "comment": null}, "merge_lname": {"type": "integer", "index": 18, "name": "merge_lname", "comment": null}, "status": {"type": "text", "index": 19, "name": "status", "comment": null}, "timestamp_opt": {"type": "timestamp without time zone", "index": 20, "name": "timestamp_opt", "comment": null}, "timestamp_signup": {"type": "timestamp without time zone", "index": 21, "name": "timestamp_signup", "comment": null}, "timezone": {"type": "text", "index": 22, "name": "timezone", "comment": null}, "unique_email_id": {"type": "text", "index": 23, "name": "unique_email_id", "comment": null}, "vip": {"type": "boolean", "index": 24, "name": "vip", "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": "source.mailchimp_source.mailchimp.member"}, "source.mailchimp_source.mailchimp.segment": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "segment", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_id", "comment": null}, "member_count": {"type": "integer", "index": 6, "name": "member_count", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "type": {"type": "text", "index": 8, "name": "type", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 9, "name": "updated_at", "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": "source.mailchimp_source.mailchimp.segment"}, "source.mailchimp_source.mailchimp.segment_member": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "segment_member", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"member_id": {"type": "text", "index": 1, "name": "member_id", "comment": null}, "segment_id": {"type": "integer", "index": 2, "name": "segment_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 5, "name": "list_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": "source.mailchimp_source.mailchimp.segment_member"}, "source.mailchimp_source.mailchimp.unsubscribe": {"metadata": {"type": "BASE TABLE", "schema": "mailchimp_source_integration_tests", "name": "unsubscribe", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": null}, "member_id": {"type": "text", "index": 2, "name": "member_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "list_id": {"type": "text", "index": 4, "name": "list_id", "comment": null}, "reason": {"type": "integer", "index": 5, "name": "reason", "comment": null}, "timestamp": {"type": "timestamp without time zone", "index": 6, "name": "timestamp", "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": "source.mailchimp_source.mailchimp.unsubscribe"}}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index ee9f297..182b6b4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
icons
- diff --git a/docs/manifest.json b/docs/manifest.json index 6de1a47..077d576 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-10-22T16:06:50.685272Z", "invocation_id": "93fff409-e037-41f9-8d04-fe719ae3d15b", "env": {}, "project_id": "faebc42304447d4427374f806679ecb5", "user_id": "e607f749-4294-4b15-833b-0ae4a87d4d24", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"model.mailchimp_source.stg_mailchimp__segments": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segments_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segments_tmp')),\n staging_columns=get_segment_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segments"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__segments.sql", "original_file_path": "models/stg_mailchimp__segments.sql", "name": "stg_mailchimp__segments", "alias": "stg_mailchimp__segments", "checksum": {"name": "sha256", "checksum": "9a541d259b8016fe2430ed426ebf18b892a675e034a30ad5c0ac1b53337e5d8d"}, "tags": [], "refs": [["stg_mailchimp__segments_tmp"], ["stg_mailchimp__segments_tmp"]], "sources": [], "description": "Each record represents a segment in Mailchimp.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_name": {"name": "segment_name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_type": {"name": "segment_type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments_tmp`\n\n),\n\n\nfields as (\n\n select\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 \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_count\n \n as \n \n member_count\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_recipients_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_recipients_tmp')),\n staging_columns=get_campaign_recipient_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__campaign_recipients.sql", "original_file_path": "models/stg_mailchimp__campaign_recipients.sql", "name": "stg_mailchimp__campaign_recipients", "alias": "stg_mailchimp__campaign_recipients", "checksum": {"name": "sha256", "checksum": "962d18c80e7e0267bb0e229f1753457fb9be4f88fb9794590dddd173811d0c3a"}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients_tmp"], ["stg_mailchimp__campaign_recipients_tmp"]], "sources": [], "description": "Each record represents the send of a campaign email.", "columns": {"email_id": {"name": "email_id", "description": "The surrogate key that uses table campaign_id and member_id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918812, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n to_hex(md5(cast(coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`"}, "model.mailchimp_source.stg_mailchimp__lists": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__lists_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__lists_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_list_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__lists"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__lists.sql", "original_file_path": "models/stg_mailchimp__lists.sql", "name": "stg_mailchimp__lists", "alias": "stg_mailchimp__lists", "checksum": {"name": "sha256", "checksum": "4d6a8a6e5f037e2b841245e3006ce38a78ae09f8fb01bc3d520f81d6242f46a5"}, "tags": [], "refs": [["stg_mailchimp__lists_tmp"], ["stg_mailchimp__lists_tmp"]], "sources": [], "description": "Each record represents a list in Mailchimp.", "columns": {"list_id": {"name": "list_id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__lists.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918812, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists_tmp`\n\n),\n\n\nfields as (\n\n select\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 beamer_address\n \n as \n \n beamer_address\n \n, \n \n \n contact_address_1\n \n as \n \n contact_address_1\n \n, \n \n \n contact_address_2\n \n as \n \n contact_address_2\n \n, \n \n \n contact_city\n \n as \n \n contact_city\n \n, \n \n \n contact_company\n \n as \n \n contact_company\n \n, \n \n \n contact_country\n \n as \n \n contact_country\n \n, \n \n \n contact_state\n \n as \n \n contact_state\n \n, \n \n \n contact_zip\n \n as \n \n contact_zip\n \n, \n \n \n date_created\n \n as \n \n date_created\n \n, \n \n \n default_from_email\n \n as \n \n default_from_email\n \n, \n \n \n default_from_name\n \n as \n \n default_from_name\n \n, \n \n \n default_language\n \n as \n \n default_language\n \n, \n \n \n default_subject\n \n as \n \n default_subject\n \n, \n \n \n email_type_option\n \n as \n \n email_type_option\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_rating\n \n as \n \n list_rating\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notify_on_subscribe\n \n as \n \n notify_on_subscribe\n \n, \n \n \n notify_on_unsubscribe\n \n as \n \n notify_on_unsubscribe\n \n, \n \n \n permission_reminder\n \n as \n \n permission_reminder\n \n, \n \n \n subscribe_url_long\n \n as \n \n subscribe_url_long\n \n, \n \n \n subscribe_url_short\n \n as \n \n subscribe_url_short\n \n, \n \n \n use_archive_bar\n \n as \n \n use_archive_bar\n \n, \n \n \n visibility\n \n as \n \n visibility\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`"}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_activities_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_activities_tmp')),\n staging_columns=get_automation_recipient_activity_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['action_type', 'automation_email_id', 'member_id', 'activity_timestamp']) }} as activity_id\n from final\n)\n\nselect * from unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automation_activities.sql", "original_file_path": "models/stg_mailchimp__automation_activities.sql", "name": "stg_mailchimp__automation_activities", "alias": "stg_mailchimp__automation_activities", "checksum": {"name": "sha256", "checksum": "8f14be4acd168cb711c17e39998f9170001c7e2cbb9259a6561bc2c9b9164d17"}, "tags": [], "refs": [["stg_mailchimp__automation_activities_tmp"], ["stg_mailchimp__automation_activities_tmp"]], "sources": [], "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nwith base as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(action_type as \n string\n), '') || '-' || coalesce(cast(automation_email_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(activity_timestamp as \n string\n), '') as \n string\n))) as activity_id\n from final\n)\n\nselect * from unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`"}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__unsubscribes_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__unsubscribes_tmp')),\n staging_columns=get_unsubscribe_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key([ 'member_id', 'list_id', 'unsubscribe_timestamp']) }} as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_unsubscribe_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__unsubscribes"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__unsubscribes.sql", "original_file_path": "models/stg_mailchimp__unsubscribes.sql", "name": "stg_mailchimp__unsubscribes", "alias": "stg_mailchimp__unsubscribes", "checksum": {"name": "sha256", "checksum": "84ac8d45eb7917b03369f407770d7e279978cdd84d657c085c788524f7600e02"}, "tags": [], "refs": [["stg_mailchimp__unsubscribes_tmp"], ["stg_mailchimp__unsubscribes_tmp"]], "sources": [], "description": "Each record represents a member who unsubscribed.", "columns": {"unsubscribe_id": {"name": "unsubscribe_id", "description": "The surrogate key that uses table member_id, list_id, and unsubscribe_timestamp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__unsubscribes.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918812, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(list_id as \n string\n), '') || '-' || coalesce(cast(unsubscribe_timestamp as \n string\n), '') as \n string\n))) as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`"}, "model.mailchimp_source.stg_mailchimp__campaigns": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaigns_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaigns_tmp')),\n staging_columns=get_campaign_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaigns"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__campaigns.sql", "original_file_path": "models/stg_mailchimp__campaigns.sql", "name": "stg_mailchimp__campaigns", "alias": "stg_mailchimp__campaigns", "checksum": {"name": "sha256", "checksum": "56693d69d8c258df63e0d9bedc7606959093d93608786b62065df629537f7e96"}, "tags": [], "refs": [["stg_mailchimp__campaigns_tmp"], ["stg_mailchimp__campaigns_tmp"]], "sources": [], "description": "Each record represents a campaign in Mailchimp.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_timestamp": {"name": "create_timestamp", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to_email": {"name": "reply_to_email", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaigns.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918812, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns_tmp`\n\n),\n\n\nfields as (\n\n select\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 archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n long_archive_url\n \n as \n \n long_archive_url\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n test_size\n \n as \n \n test_size\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n, \n \n \n wait_time\n \n as \n \n wait_time\n \n, \n \n \n winner_criteria\n \n as \n \n winner_criteria\n \n, \n \n \n winning_campaign_id\n \n as \n \n winning_campaign_id\n \n, \n \n \n winning_combination_id\n \n as \n \n winning_combination_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`"}, "model.mailchimp_source.stg_mailchimp__automations": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__automations_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automations_tmp')),\n staging_columns=get_automation_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automations"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automations.sql", "original_file_path": "models/stg_mailchimp__automations.sql", "name": "stg_mailchimp__automations", "alias": "stg_mailchimp__automations", "checksum": {"name": "sha256", "checksum": "d53e4be91338f237ad9434b3962987eea297a7259b2109096f46c8a04df49144"}, "tags": [], "refs": [["stg_mailchimp__automations_tmp"], ["stg_mailchimp__automations_tmp"]], "sources": [], "description": "Each record represents an automation in Mailchimp.", "columns": {"automation_id": {"name": "automation_id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automations.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations_tmp`\n\n),\n\nfields as (\n\n select\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 create_time\n \n as \n \n create_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n trigger_settings\n \n as \n \n trigger_settings\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`"}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_emails_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_emails_tmp')),\n staging_columns=get_automation_email_columns()\n )\n }}\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_email_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_emails"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automation_emails.sql", "original_file_path": "models/stg_mailchimp__automation_emails.sql", "name": "stg_mailchimp__automation_emails", "alias": "stg_mailchimp__automation_emails", "checksum": {"name": "sha256", "checksum": "d4a7ad6a314a52074f4cc4486a63f7f1f1f9bf7b89605427d38c10fa33bf9f38"}, "tags": [], "refs": [["stg_mailchimp__automation_emails_tmp"], ["stg_mailchimp__automation_emails_tmp"]], "sources": [], "description": "Each record represents an automation email (that make up automations).", "columns": {"automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_emails.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nwith base as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails_tmp`\n\n), \n\nfields as (\n\n select \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 archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n automation_id\n \n as \n \n automation_id\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n delay_action\n \n as \n \n delay_action\n \n, \n \n \n delay_action_description\n \n as \n \n delay_action_description\n \n, \n \n \n delay_amount\n \n as \n \n delay_amount\n \n, \n \n \n delay_direction\n \n as \n \n delay_direction\n \n, \n \n \n delay_full_description\n \n as \n \n delay_full_description\n \n, \n \n \n delay_type\n \n as \n \n delay_type\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n\n\n\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`"}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_recipients_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_recipients_tmp')),\n staging_columns=get_automation_recipient_columns()\n )\n }}\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n {{ dbt_utils.surrogate_key(['member_id','automation_email_id']) }} as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__automation_recipients.sql", "original_file_path": "models/stg_mailchimp__automation_recipients.sql", "name": "stg_mailchimp__automation_recipients", "alias": "stg_mailchimp__automation_recipients", "checksum": {"name": "sha256", "checksum": "0b527204f8677d081d0c2ee753e4dcc39e166176599674729ab183e1ceeab443"}, "tags": [], "refs": [["stg_mailchimp__automation_recipients_tmp"], ["stg_mailchimp__automation_recipients_tmp"]], "sources": [], "description": "Each record represents info about the recipient of each automation.", "columns": {"automation_recipient_id": {"name": "automation_recipient_id", "description": "Surrogate key that uses member_id and automation_email_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nwith base as (\n\n select *\n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients_tmp`\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n to_hex(md5(cast(coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(automation_email_id as \n string\n), '') as \n string\n))) as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`"}, "model.mailchimp_source.stg_mailchimp__members": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__members_tmp')),\n staging_columns=get_member_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n {{ fivetran_utils.fill_pass_through_columns('mailchimp__members_pass_through_columns') }}\n \n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_member_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__members"], "unique_id": "model.mailchimp_source.stg_mailchimp__members", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__members.sql", "original_file_path": "models/stg_mailchimp__members.sql", "name": "stg_mailchimp__members", "alias": "stg_mailchimp__members", "checksum": {"name": "sha256", "checksum": "0f1845646b840c30faa0cd9a863899b592ca5cb9307fba2e81829fc85aa038a0"}, "tags": [], "refs": [["stg_mailchimp__members_tmp"], ["stg_mailchimp__members_tmp"]], "sources": [], "description": "Each record represents a member in Mailchimp.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_timestamp": {"name": "signup_timestamp", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_timestamp": {"name": "opt_in_timestamp", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed_timestamp": {"name": "last_changed_timestamp", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_ip_address": {"name": "opt_in_ip_address", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_ip_address": {"name": "signup_ip_address", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918812, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n dstoff\n \n as \n \n dstoff\n \n, \n \n \n email_address\n \n as \n \n email_address\n \n, \n \n \n email_client\n \n as \n \n email_client\n \n, \n \n \n email_type\n \n as \n \n email_type\n \n, \n \n \n gmtoff\n \n as \n \n gmtoff\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n ip_opt\n \n as \n \n ip_opt\n \n, \n \n \n ip_signup\n \n as \n \n ip_signup\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n last_changed\n \n as \n \n last_changed\n \n, \n \n \n latitude\n \n as \n \n latitude\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n longitude\n \n as \n \n longitude\n \n, \n \n \n member_rating\n \n as \n \n member_rating\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n timestamp_opt\n \n as \n \n timestamp_opt\n \n, \n \n \n timestamp_signup\n \n as \n \n timestamp_signup\n \n, \n \n \n timezone\n \n as \n \n timezone\n \n, \n \n \n unique_email_id\n \n as \n \n unique_email_id\n \n, \n \n \n vip\n \n as \n \n vip\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n \n\n\n\n\n \n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`"}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_activities_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_activities_tmp')),\n staging_columns=get_campaign_recipient_activity_columns()\n )\n }}\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n {{ dbt_utils.surrogate_key(['action_type', 'campaign_id', 'member_id', 'activity_timestamp']) }} as activity_id,\n {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__campaign_activities.sql", "original_file_path": "models/stg_mailchimp__campaign_activities.sql", "name": "stg_mailchimp__campaign_activities", "alias": "stg_mailchimp__campaign_activities", "checksum": {"name": "sha256", "checksum": "8d4a84a98808c477676406497afd536b55e88dd028845c96dc2912a52abe06cc"}, "tags": [], "refs": [["stg_mailchimp__campaign_activities_tmp"], ["stg_mailchimp__campaign_activities_tmp"]], "sources": [], "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_id": {"name": "email_id", "description": "The ID of the email sent. (Created in dbt, not Mailchimp.)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1634918812, "compiled_sql": "with base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities_tmp`\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n to_hex(md5(cast(coalesce(cast(action_type as \n string\n), '') || '-' || coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') || '-' || coalesce(cast(activity_timestamp as \n string\n), '') as \n string\n))) as activity_id,\n to_hex(md5(cast(coalesce(cast(campaign_id as \n string\n), '') || '-' || coalesce(cast(member_id as \n string\n), '') as \n string\n))) as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`"}, "model.mailchimp_source.stg_mailchimp__segment_members": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segment_members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segment_members_tmp')),\n staging_columns=get_segment_member_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_member_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segment_members"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "stg_mailchimp__segment_members.sql", "original_file_path": "models/stg_mailchimp__segment_members.sql", "name": "stg_mailchimp__segment_members", "alias": "stg_mailchimp__segment_members", "checksum": {"name": "sha256", "checksum": "86acbc06483f991f2e5a9f970cc458041efbc105b949237f707432ed6c354c35"}, "tags": [], "refs": [["stg_mailchimp__segment_members_tmp"], ["stg_mailchimp__segment_members_tmp"]], "sources": [], "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segment_members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members_tmp`\n\n),\n\n\nfields as (\n\n select\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 list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members`"}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient_activity') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient_activity"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automation_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_activities_tmp.sql", "name": "stg_mailchimp__automation_activities_tmp", "alias": "stg_mailchimp__automation_activities_tmp", "checksum": {"name": "sha256", "checksum": "99dd3be31bece932a946f44c80ffe85b9b21d998ddaf1d7a4fb9108f9b4f3566"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient_activity"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation_recipient_activity`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities_tmp`"}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"raw_sql": "select * from {{ var('unsubscribe') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.unsubscribe"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__unsubscribes_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__unsubscribes_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "name": "stg_mailchimp__unsubscribes_tmp", "alias": "stg_mailchimp__unsubscribes_tmp", "checksum": {"name": "sha256", "checksum": "49ddeb7631aa624011d6fd5f608b80fa284ca6443a837c941d31cc864e99efca"}, "tags": [], "refs": [], "sources": [["mailchimp", "unsubscribe"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918812, "compiled_sql": "select * from `bigquery`.`mailchimp`.`unsubscribe`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes_tmp`"}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"raw_sql": "select * from {{ var('list') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.list"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__lists_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__lists_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__lists_tmp.sql", "name": "stg_mailchimp__lists_tmp", "alias": "stg_mailchimp__lists_tmp", "checksum": {"name": "sha256", "checksum": "f2334dfd1f22372c81a53cb1903dc8accef34fbf98c0a3477bd0ca373cffd83d"}, "tags": [], "refs": [], "sources": [["mailchimp", "list"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__lists_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918812, "compiled_sql": "select * from `bigquery`.`mailchimp`.`list`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"raw_sql": "select * from {{ var('campaign_recipient') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "name": "stg_mailchimp__campaign_recipients_tmp", "alias": "stg_mailchimp__campaign_recipients_tmp", "checksum": {"name": "sha256", "checksum": "6208dd636a377fb8462ee7838ec92a9b3592f5861f42c6dd803aa8c32e6fe3f5"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918812, "compiled_sql": "select * from `bigquery`.`mailchimp`.`campaign_recipient`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients_tmp`"}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('mailchimp_segment') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segments_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__segments_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segments_tmp.sql", "name": "stg_mailchimp__segments_tmp", "alias": "stg_mailchimp__segments_tmp", "checksum": {"name": "sha256", "checksum": "4235011fcab4cb786bf93907ba23fa09882a56e9430b6fc13bf0425c2cb5cc09"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segments_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`segment`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"raw_sql": "select * from {{ var('campaign') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaigns_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__campaigns_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaigns_tmp.sql", "name": "stg_mailchimp__campaigns_tmp", "alias": "stg_mailchimp__campaigns_tmp", "checksum": {"name": "sha256", "checksum": "b96a24c9964cf05208bd2a9e0d0ce0455a507b9f07026887f777922df4942cd9"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaigns_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918812, "compiled_sql": "select * from `bigquery`.`mailchimp`.`campaign`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns_tmp`"}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('segment_member') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment_member"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segment_members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__segment_members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segment_members_tmp.sql", "name": "stg_mailchimp__segment_members_tmp", "alias": "stg_mailchimp__segment_members_tmp", "checksum": {"name": "sha256", "checksum": "5b6ac15d76b277f0b9f4d99dab168471e7e599bf8e79bd491dc412cfd5e9b48b"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment_member"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segment_members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`segment_member`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segment_members_tmp`"}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"raw_sql": "select * from {{ var('member') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.member"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__members_tmp.sql", "name": "stg_mailchimp__members_tmp", "alias": "stg_mailchimp__members_tmp", "checksum": {"name": "sha256", "checksum": "5fe9a82d5a301c2dd82f196d47d882b6c2083528bd8b53f1a49591496b729b5e"}, "tags": [], "refs": [], "sources": [["mailchimp", "member"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918812, "compiled_sql": "select * from `bigquery`.`mailchimp`.`member`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members_tmp`"}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automations_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automations_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automations_tmp.sql", "name": "stg_mailchimp__automations_tmp", "alias": "stg_mailchimp__automations_tmp", "checksum": {"name": "sha256", "checksum": "2d97a5eacee487f94b5553490b28db0d5252d917897965fa442e884a547e78d3"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automations_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations_tmp`"}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_email') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_email"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_emails_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automation_emails_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_emails_tmp.sql", "name": "stg_mailchimp__automation_emails_tmp", "alias": "stg_mailchimp__automation_emails_tmp", "checksum": {"name": "sha256", "checksum": "9ee9a3419a66bfb12b2c084315fdf33a0751480aa6b206c201cfb3feca13a465"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_email"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_emails_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation_email`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails_tmp`"}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"raw_sql": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__automation_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "name": "stg_mailchimp__automation_recipients_tmp", "alias": "stg_mailchimp__automation_recipients_tmp", "checksum": {"name": "sha256", "checksum": "28eeb5e9f065dcf688d7bff8b450ba06adb13628fe476e0091d49740ed8b1241"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1634918812, "compiled_sql": "\n\nselect * from `bigquery`.`mailchimp`.`automation_recipient`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients_tmp`"}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"raw_sql": "select * from {{ var('campaign_recipient_activity') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "stg_mailchimp", "database": null, "tags": [], "full_refresh": null, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "name": "stg_mailchimp__campaign_activities_tmp", "alias": "stg_mailchimp__campaign_activities_tmp", "checksum": {"name": "sha256", "checksum": "50e7e9bdfd1bded394388edd76798d6b59b30bbfac7181e2e108401c179c9e78"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient_activity"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1634918812, "compiled_sql": "select * from `bigquery`.`mailchimp`.`campaign_recipient_activity`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities_tmp`"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_activities') }} where {{config.get('where')}}) stg_mailchimp__automation_activities{% else %}{{ ref('stg_mailchimp__automation_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_activities_activity_id", "alias": "not_null_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_activities') }} where {{config.get('where')}}) stg_mailchimp__automation_activities{% else %}{{ ref('stg_mailchimp__automation_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_activities_activity_id", "alias": "unique_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_activities`\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_emails') }} where {{config.get('where')}}) stg_mailchimp__automation_emails{% else %}{{ ref('stg_mailchimp__automation_emails') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_emails_automation_email_id", "alias": "unique_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n automation_email_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\nwhere automation_email_id is not null\ngroup by automation_email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_emails') }} where {{config.get('where')}}) stg_mailchimp__automation_emails{% else %}{{ ref('stg_mailchimp__automation_emails') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_emails_automation_email_id", "alias": "not_null_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_emails`\nwhere automation_email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}{{ config(alias=\"not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154\") }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_recipient_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_recipients') }} where {{config.get('where')}}) stg_mailchimp__automation_recipients{% else %}{{ ref('stg_mailchimp__automation_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154"}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\nwhere automation_recipient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id"}, "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}{{ config(alias=\"unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db\") }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_recipient_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automation_recipients') }} where {{config.get('where')}}) stg_mailchimp__automation_recipients{% else %}{{ ref('stg_mailchimp__automation_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db"}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n automation_recipient_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automation_recipients`\nwhere automation_recipient_id is not null\ngroup by automation_recipient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id"}, "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automations') }} where {{config.get('where')}}) stg_mailchimp__automations{% else %}{{ ref('stg_mailchimp__automations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automations_automation_id", "alias": "unique_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n automation_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\nwhere automation_id is not null\ngroup by automation_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id"}, "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__automations') }} where {{config.get('where')}}) stg_mailchimp__automations{% else %}{{ ref('stg_mailchimp__automations') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automations_automation_id", "alias": "not_null_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__automations"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__automations`\nwhere automation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_recipients') }} where {{config.get('where')}}) stg_mailchimp__campaign_recipients{% else %}{{ ref('stg_mailchimp__campaign_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_recipients_email_id", "alias": "unique_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n email_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\nwhere email_id is not null\ngroup by email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "email_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_recipients') }} where {{config.get('where')}}) stg_mailchimp__campaign_recipients{% else %}{{ ref('stg_mailchimp__campaign_recipients') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_recipients_email_id", "alias": "not_null_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_recipients`\nwhere email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_activities') }} where {{config.get('where')}}) stg_mailchimp__campaign_activities{% else %}{{ ref('stg_mailchimp__campaign_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_activities_activity_id", "alias": "unique_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaign_activities') }} where {{config.get('where')}}) stg_mailchimp__campaign_activities{% else %}{{ ref('stg_mailchimp__campaign_activities') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_activities_activity_id", "alias": "not_null_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaign_activities`\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id"}, "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaigns') }} where {{config.get('where')}}) stg_mailchimp__campaigns{% else %}{{ ref('stg_mailchimp__campaigns') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaigns_campaign_id", "alias": "unique_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n campaign_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\nwhere campaign_id is not null\ngroup by campaign_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id"}, "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__campaigns') }} where {{config.get('where')}}) stg_mailchimp__campaigns{% else %}{{ ref('stg_mailchimp__campaigns') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaigns_campaign_id", "alias": "not_null_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__campaigns`\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id"}, "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "list_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__lists') }} where {{config.get('where')}}) stg_mailchimp__lists{% else %}{{ ref('stg_mailchimp__lists') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__lists_list_id", "alias": "unique_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n list_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\nwhere list_id is not null\ngroup by list_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id"}, "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__lists') }} where {{config.get('where')}}) stg_mailchimp__lists{% else %}{{ ref('stg_mailchimp__lists') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__lists_list_id", "alias": "not_null_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__lists"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__lists`\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id"}, "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "member_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__members') }} where {{config.get('where')}}) stg_mailchimp__members{% else %}{{ ref('stg_mailchimp__members') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__members_member_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__members_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__members_member_id", "alias": "unique_stg_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n member_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\nwhere member_id is not null\ngroup by member_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id"}, "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "member_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__members') }} where {{config.get('where')}}) stg_mailchimp__members{% else %}{{ ref('stg_mailchimp__members') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__members_member_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__members_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__members_member_id", "alias": "not_null_stg_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__members"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__members`\nwhere member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id"}, "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__segments') }} where {{config.get('where')}}) stg_mailchimp__segments{% else %}{{ ref('stg_mailchimp__segments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__segments_segment_id", "alias": "unique_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n segment_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\nwhere segment_id is not null\ngroup by segment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id"}, "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__segments') }} where {{config.get('where')}}) stg_mailchimp__segments{% else %}{{ ref('stg_mailchimp__segments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__segments_segment_id", "alias": "not_null_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__segments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__segments`\nwhere segment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id"}, "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unsubscribe_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__unsubscribes') }} where {{config.get('where')}}) stg_mailchimp__unsubscribes{% else %}{{ ref('stg_mailchimp__unsubscribes') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "not_null_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\nwhere unsubscribe_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id"}, "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unsubscribe_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_mailchimp__unsubscribes') }} where {{config.get('where')}}) stg_mailchimp__unsubscribes{% else %}{{ ref('stg_mailchimp__unsubscribes') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "bigquery", "schema": "dbt_renee_dbt_test__audit", "fqn": ["mailchimp_source", "schema_test", "unique_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "schema_test/unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/schema_test/unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634918812, "compiled_sql": "\n \n \n\nselect\n unsubscribe_id as unique_field,\n count(*) as n_records\n\nfrom `bigquery`.`dbt_renee_stg_mailchimp`.`stg_mailchimp__unsubscribes`\nwhere unsubscribe_id is not null\ngroup by unsubscribe_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"fqn": ["mailchimp_source", "mailchimp", "automation"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.automation_email": {"fqn": ["mailchimp_source", "mailchimp", "automation_email"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_email", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_email", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_email", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation email (that make up automations).", "columns": {"id": {"name": "id", "description": "The ID of the email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation_email`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.automation_recipient": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents info about the recipient of each automation.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation_recipient`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient_activity"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`automation_recipient_activity`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.campaign": {"fqn": ["mailchimp_source", "mailchimp", "campaign"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a campaign in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`campaign`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.campaign_recipient": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents the send of a campaign email.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`campaign_recipient`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient_activity"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`campaign_recipient_activity`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.segment": {"fqn": ["mailchimp_source", "mailchimp", "segment"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.segment", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a segment in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`segment`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.segment_member": {"fqn": ["mailchimp_source", "mailchimp", "segment_member"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.segment_member", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment_member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment_member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`segment_member`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.list": {"fqn": ["mailchimp_source", "mailchimp", "list"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.list", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "list", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "list", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a list in Mailchimp.", "columns": {"id": {"name": "id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`list`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.member": {"fqn": ["mailchimp_source", "mailchimp", "member"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.member", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member in Mailchimp. Note that this table may contain custom metadata columns which can be passed through via `mailchimp__members_pass_through_columns`.\n", "columns": {"id": {"name": "id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_signup": {"name": "timestamp_signup", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_opt": {"name": "timestamp_opt", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed": {"name": "last_changed", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_opt": {"name": "ip_opt", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_signup": {"name": "ip_signup", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`member`", "created_at": 1634918812}, "source.mailchimp_source.mailchimp.unsubscribe": {"fqn": ["mailchimp_source", "mailchimp", "unsubscribe"], "database": "bigquery", "schema": "mailchimp", "unique_id": "source.mailchimp_source.mailchimp.unsubscribe", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "unsubscribe", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "unsubscribe", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member who unsubscribed.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery`.`mailchimp`.`unsubscribe`", "created_at": 1634918812}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_table_options(config, model, temporary=false) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view(run_outside_transaction_hooks=False) %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt_bigquery.make_date_partitioned_table", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {# there should be exactly one ref or exactly one source #}\n {% set destination = this.incorporate(type='table') %}\n\n {% set dependency_type = none %}\n {% if (model.refs | length) == 1 and (model.sources | length) == 0 %}\n {% set dependency_type = 'ref' %}\n {% elif (model.refs | length) == 0 and (model.sources | length) == 1 %}\n {% set dependency_type = 'source' %}\n {% else %}\n {% set msg %}\n Expected exactly one ref or exactly one source, instead got {{ model.refs | length }} models and {{ model.sources | length }} sources.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% if dependency_type == 'ref' %}\n {% set src = ref(*model.refs[0]) %}\n {% else %}\n {% set src = source(*model.sources[0]) %}\n {% endif %}\n\n {%- set result_str = adapter.copy_table(\n src,\n destination,\n config.get('copy_materialization', 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation,\n target_relation,\n sql,\n unique_key,\n partition_by,\n partitions,\n dest_columns) %}\n\n {% else %}\n {#-- wrap sql in parens to make it a subquery --#}\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["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.run_hooks", "macro.dbt.create_table_as", "macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "materialization_test_default", "macro_sql": "\n\n{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918810}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n ;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/fishtown-analytics/dbt/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\n {%- set ns = namespace() -%} {# handle for-loop scoping with a namespace #}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_sql']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.basic_load_csv_rows": {"unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n %s\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_seed_column_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.basic_load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% do adapter.drop_relation(intermediate_relation) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.should_full_refresh", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.incremental_upsert", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.common_get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "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/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', macro_namespace = 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by 1\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_automation_recipient_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_recipient_columns.sql", "original_file_path": "macros/get_automation_recipient_columns.sql", "name": "get_automation_recipient_columns", "macro_sql": "{% macro get_automation_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_campaign_columns": {"unique_id": "macro.mailchimp_source.get_campaign_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_campaign_columns.sql", "original_file_path": "macros/get_campaign_columns.sql", "name": "get_campaign_columns", "macro_sql": "{% macro get_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"clicktale\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"content_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"long_archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reply_to\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"send_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"test_size\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timewarp\", \"datatype\": \"boolean\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_conversation\", \"datatype\": \"boolean\"},\n {\"name\": \"wait_time\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winner_criteria\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winning_campaign_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"winning_combination_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_list_columns": {"unique_id": "macro.mailchimp_source.get_list_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_list_columns.sql", "original_file_path": "macros/get_list_columns.sql", "name": "get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"beamer_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_address_1\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_address_2\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"contact_city\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"contact_zip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date_created\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"default_from_email\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"default_subject\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"email_type_option\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_rating\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"notify_on_subscribe\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"notify_on_unsubscribe\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"permission_reminder\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscribe_url_long\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscribe_url_short\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"use_archive_bar\", \"datatype\": \"boolean\"},\n {\"name\": \"visibility\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_segment_columns": {"unique_id": "macro.mailchimp_source.get_segment_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_segment_columns.sql", "original_file_path": "macros/get_segment_columns.sql", "name": "get_segment_columns", "macro_sql": "{% macro get_segment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_count\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_automation_email_columns": {"unique_id": "macro.mailchimp_source.get_automation_email_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_email_columns.sql", "original_file_path": "macros/get_automation_email_columns.sql", "name": "get_automation_email_columns", "macro_sql": "{% macro get_automation_email_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"automation_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"clicktale\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"content_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"delay_action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_action_description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_amount\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"delay_direction\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"delay_full_description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"delay_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"position\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"reply_to\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"send_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"start_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timewarp\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"use_conversation\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_member_columns": {"unique_id": "macro.mailchimp_source.get_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_member_columns.sql", "original_file_path": "macros/get_member_columns.sql", "name": "get_member_columns", "macro_sql": "{% macro get_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"country_code\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"dstoff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"email_address\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_client\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"email_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"gmtoff\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ip_opt\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"ip_signup\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"last_changed\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"latitude\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"longitude\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"member_rating\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp_opt\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"timestamp_signup\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"timezone\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"unique_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vip\", \"datatype\": \"boolean\"}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('mailchimp__members_pass_through_columns')) }}\n\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float", "macro.dbt_utils.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_automation_columns": {"unique_id": "macro.mailchimp_source.get_automation_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_columns.sql", "original_file_path": "macros/get_automation_columns.sql", "name": "get_automation_columns", "macro_sql": "{% macro get_automation_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"create_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"start_time\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"trigger_settings\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_campaign_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_campaign_recipient_activity_columns.sql", "original_file_path": "macros/get_campaign_recipient_activity_columns.sql", "name": "get_campaign_recipient_activity_columns", "macro_sql": "{% macro get_campaign_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_campaign_recipient_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_campaign_recipient_columns.sql", "original_file_path": "macros/get_campaign_recipient_columns.sql", "name": "get_campaign_recipient_columns", "macro_sql": "{% macro get_campaign_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_unsubscribe_columns": {"unique_id": "macro.mailchimp_source.get_unsubscribe_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_unsubscribe_columns.sql", "original_file_path": "macros/get_unsubscribe_columns.sql", "name": "get_unsubscribe_columns", "macro_sql": "{% macro get_unsubscribe_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_segment_member_columns": {"unique_id": "macro.mailchimp_source.get_segment_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_segment_member_columns.sql", "original_file_path": "macros/get_segment_member_columns.sql", "name": "get_segment_member_columns", "macro_sql": "{% macro get_segment_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.mailchimp_source.get_automation_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/mailchimp_source", "path": "macros/get_automation_recipient_activity_columns.sql", "original_file_path": "macros/get_automation_recipient_activity_columns.sql", "name": "get_automation_recipient_activity_columns", "macro_sql": "{% macro get_automation_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) %}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}};\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed = \n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n \n-%}\n\n \n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n \n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as previous_{{ column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, * from a_minus_b\n union all\n select 'b_minus_a' as which_diff, * from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }},\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.datediff(start_date, end_date, datepart)}}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n/*\ncall as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n)\n\n*/\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt_utils.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[]) -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\n\n {%- set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- set _ = fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set target_relation = adapter.get_relation(database=table.database,\n schema=table.schema,\n identifier=table.identifier) -%}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not target_relation and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ table ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not target_relation and default is not none -%}\n\n {{ log(\"Relation \" ~ table ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for v in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ v }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ v ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ v ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation() -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') () }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation() %}\n\n{% if var('union_schemas', none) %}\n, case\n {% for schema in var('union_schemas') %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var('union_databases', none) %}\n, case\n {% for database in var('union_databases') %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, '' as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command = \"source dbt_modules/fivetran_utils/columns_setup.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{% for t in tables %}\n {% if t != tables[-1] %}\n {% set help_command = zsh_command + t + \" && \\n\" %}\n\n {% else %}\n {% set help_command = zsh_command + t %}\n\n {% endif %}\n {{ log(help_command, info=True) }}\n\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.default__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "default__get_columns_for_macro", "macro_sql": "{% macro default__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) = 'number' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) = 'numeric' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.name == source.name %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable) %}\n\n{% if var('union_schemas', none) %}\n\n {% set relations = [] %}\n\n {% if var('union_schemas') is string %}\n {% set trimmed = var('union_schemas')|trim('[')|trim(']')|trim('(')|trim(')') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var('union_schemas') %}\n {% endif %}\n\n {% for schema in schemas %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var('union_databases', none) %}\n\n {% set relations = [] %}\n\n {% for database in var('union_databases') %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/mailchimp/development/dbt_modules/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634918811}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/Cellar/dbt/0.20.2_1/libexec/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--models` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"model.mailchimp_source.stg_mailchimp__segments": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__lists": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"], "model.mailchimp_source.stg_mailchimp__campaigns": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "model.mailchimp_source.stg_mailchimp__automations": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__members": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "model.mailchimp_source.stg_mailchimp__segment_members": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["source.mailchimp_source.mailchimp.automation_recipient_activity"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["source.mailchimp_source.mailchimp.unsubscribe"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["source.mailchimp_source.mailchimp.list"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["source.mailchimp_source.mailchimp.segment"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["source.mailchimp_source.mailchimp.campaign"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["source.mailchimp_source.mailchimp.segment_member"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["source.mailchimp_source.mailchimp.member"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["source.mailchimp_source.mailchimp.automation"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["source.mailchimp_source.mailchimp.automation_email"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["source.mailchimp_source.mailchimp.automation_recipient"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "source.mailchimp_source.mailchimp.automation": [], "source.mailchimp_source.mailchimp.automation_email": [], "source.mailchimp_source.mailchimp.automation_recipient": [], "source.mailchimp_source.mailchimp.automation_recipient_activity": [], "source.mailchimp_source.mailchimp.campaign": [], "source.mailchimp_source.mailchimp.campaign_recipient": [], "source.mailchimp_source.mailchimp.campaign_recipient_activity": [], "source.mailchimp_source.mailchimp.segment": [], "source.mailchimp_source.mailchimp.segment_member": [], "source.mailchimp_source.mailchimp.list": [], "source.mailchimp_source.mailchimp.member": [], "source.mailchimp_source.mailchimp.unsubscribe": []}, "child_map": {"model.mailchimp_source.stg_mailchimp__segments": ["test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00", "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6", "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa"], "model.mailchimp_source.stg_mailchimp__lists": ["test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d", "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67", "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e", "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816"], "model.mailchimp_source.stg_mailchimp__campaigns": ["test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4", "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346"], "model.mailchimp_source.stg_mailchimp__automations": ["test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1", "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84", "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48", "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9"], "model.mailchimp_source.stg_mailchimp__members": ["test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c", "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed", "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee"], "model.mailchimp_source.stg_mailchimp__segment_members": [], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_activities"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp_source.stg_mailchimp__lists"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp_source.stg_mailchimp__campaign_recipients"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["model.mailchimp_source.stg_mailchimp__segments", "model.mailchimp_source.stg_mailchimp__segments"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["model.mailchimp_source.stg_mailchimp__segment_members", "model.mailchimp_source.stg_mailchimp__segment_members"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["model.mailchimp_source.stg_mailchimp__members", "model.mailchimp_source.stg_mailchimp__members"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automation_emails"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automation_recipients"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67": [], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d": [], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48": [], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9": [], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096": [], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed": [], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346": [], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4": [], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb": [], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d": [], "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9": [], "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c": [], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83": [], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00": [], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e": [], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816": [], "source.mailchimp_source.mailchimp.automation": ["model.mailchimp_source.stg_mailchimp__automations_tmp"], "source.mailchimp_source.mailchimp.automation_email": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "source.mailchimp_source.mailchimp.automation_recipient": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "source.mailchimp_source.mailchimp.automation_recipient_activity": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "source.mailchimp_source.mailchimp.campaign": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient_activity": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "source.mailchimp_source.mailchimp.segment": ["model.mailchimp_source.stg_mailchimp__segments_tmp"], "source.mailchimp_source.mailchimp.segment_member": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "source.mailchimp_source.mailchimp.list": ["model.mailchimp_source.stg_mailchimp__lists_tmp"], "source.mailchimp_source.mailchimp.member": ["model.mailchimp_source.stg_mailchimp__members_tmp"], "source.mailchimp_source.mailchimp.unsubscribe": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}} \ 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-12-15T16:02:19.241947Z", "invocation_id": "ca9318cc-9843-47a5-8982-a6c7f5766aaf", "env": {}, "project_id": "756d0878a63fe2cb3d32f22caa3ac534", "user_id": "8929baf0-9bc1-477e-9a57-eb8b0db4da62", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.mailchimp_source_integration_tests.campaign_recipient": {"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"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "campaign_recipient"], "unique_id": "seed.mailchimp_source_integration_tests.campaign_recipient", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "campaign_recipient.csv", "original_file_path": "seeds/campaign_recipient.csv", "name": "campaign_recipient", "alias": "campaign_recipient", "checksum": {"name": "sha256", "checksum": "cb31529c2188f1da5bcb3a93ac632ac4e82be17ec9340d59d73fe5330dc64709"}, "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 == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671120128.541462, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"campaign_recipient\""}, "seed.mailchimp_source_integration_tests.unsubscribe": {"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", "timestamp": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "unsubscribe"], "unique_id": "seed.mailchimp_source_integration_tests.unsubscribe", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "unsubscribe.csv", "original_file_path": "seeds/unsubscribe.csv", "name": "unsubscribe", "alias": "unsubscribe", "checksum": {"name": "sha256", "checksum": "99e9e3b789b10457d77656dc1c19c2139f9b3f78b6d12bc366ff51d71e109053"}, "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 == 'redshift' else false }}", "column_types": {"timestamp": "timestamp"}}, "created_at": 1671120128.547431, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"unsubscribe\""}, "seed.mailchimp_source_integration_tests.automation": {"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", "create_time": "timestamp", "start_time": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "automation"], "unique_id": "seed.mailchimp_source_integration_tests.automation", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "automation.csv", "original_file_path": "seeds/automation.csv", "name": "automation", "alias": "automation", "checksum": {"name": "sha256", "checksum": "f028fba74467acc555f96870c82f34e3262219db1242c384dcb6aca31ce4533a"}, "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 == 'redshift' else false }}", "column_types": {"create_time": "timestamp", "start_time": "timestamp"}}, "created_at": 1671120128.5487459, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation\""}, "seed.mailchimp_source_integration_tests.segment_member": {"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"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "segment_member"], "unique_id": "seed.mailchimp_source_integration_tests.segment_member", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "segment_member.csv", "original_file_path": "seeds/segment_member.csv", "name": "segment_member", "alias": "segment_member", "checksum": {"name": "sha256", "checksum": "4c7e9de9f27d34898558335722361a793d7ebd14c80195b83c6e5ccafc3d439d"}, "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 == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671120128.549939, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"segment_member\""}, "seed.mailchimp_source_integration_tests.automation_email": {"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", "create_time": "timestamp", "start_time": "timestamp", "send_time": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "automation_email"], "unique_id": "seed.mailchimp_source_integration_tests.automation_email", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "automation_email.csv", "original_file_path": "seeds/automation_email.csv", "name": "automation_email", "alias": "automation_email", "checksum": {"name": "sha256", "checksum": "a69df563c356f036acad789080955128589de846c9462807332638b616c4fab2"}, "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 == 'redshift' else false }}", "column_types": {"create_time": "timestamp", "start_time": "timestamp", "send_time": "timestamp"}}, "created_at": 1671120128.551243, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation_email\""}, "seed.mailchimp_source_integration_tests.automation_recipient": {"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"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "automation_recipient"], "unique_id": "seed.mailchimp_source_integration_tests.automation_recipient", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "automation_recipient.csv", "original_file_path": "seeds/automation_recipient.csv", "name": "automation_recipient", "alias": "automation_recipient", "checksum": {"name": "sha256", "checksum": "69a264c9f69f62914207f0a216d99853f785c2f93e484d08f7e5796a87118309"}, "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 == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671120128.552397, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation_recipient\""}, "seed.mailchimp_source_integration_tests.campaign_recipient_activity": {"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", "timestamp": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "campaign_recipient_activity"], "unique_id": "seed.mailchimp_source_integration_tests.campaign_recipient_activity", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "campaign_recipient_activity.csv", "original_file_path": "seeds/campaign_recipient_activity.csv", "name": "campaign_recipient_activity", "alias": "campaign_recipient_activity", "checksum": {"name": "sha256", "checksum": "7153850f284009e74ff5a7efb9d3672cba2356d90fe3f9496b98cfba49973325"}, "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 == 'redshift' else false }}", "column_types": {"timestamp": "timestamp"}}, "created_at": 1671120128.5535848, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"campaign_recipient_activity\""}, "seed.mailchimp_source_integration_tests.list": {"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", "list_rating": "float", "date_created": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "list"], "unique_id": "seed.mailchimp_source_integration_tests.list", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "list.csv", "original_file_path": "seeds/list.csv", "name": "list", "alias": "list", "checksum": {"name": "sha256", "checksum": "c83039439d86a0cb1bf74dcd23f948b658ee637bb9dff3e1c3d9503c3215943b"}, "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 == 'redshift' else false }}", "column_types": {"list_rating": "float", "date_created": "timestamp"}}, "created_at": 1671120128.554807, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"list\""}, "seed.mailchimp_source_integration_tests.member": {"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", "dstoff": "float", "gmtoff": "float", "last_changed": "timestamp", "timestamp_opt": "timestamp", "timestamp_signup": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "member"], "unique_id": "seed.mailchimp_source_integration_tests.member", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "member.csv", "original_file_path": "seeds/member.csv", "name": "member", "alias": "member", "checksum": {"name": "sha256", "checksum": "cd850a858188fb7552f757a4df04cc44f745d91be2eb7d5260cff3bd7ddb2592"}, "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 == 'redshift' else false }}", "column_types": {"dstoff": "float", "gmtoff": "float", "last_changed": "timestamp", "timestamp_opt": "timestamp", "timestamp_signup": "timestamp"}}, "created_at": 1671120128.5561962, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"member\""}, "seed.mailchimp_source_integration_tests.segment": {"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", "created_at": "timestamp", "updated_at": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "segment"], "unique_id": "seed.mailchimp_source_integration_tests.segment", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "segment.csv", "original_file_path": "seeds/segment.csv", "name": "segment", "alias": "segment", "checksum": {"name": "sha256", "checksum": "6ef5870a1a5e6a9f14f98391de269779525e19026df2ab50bbd7025baf0aa87b"}, "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 == 'redshift' else false }}", "column_types": {"created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1671120128.557429, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"segment\""}, "seed.mailchimp_source_integration_tests.automation_recipient_activity": {"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", "timestamp": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "automation_recipient_activity"], "unique_id": "seed.mailchimp_source_integration_tests.automation_recipient_activity", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "automation_recipient_activity.csv", "original_file_path": "seeds/automation_recipient_activity.csv", "name": "automation_recipient_activity", "alias": "automation_recipient_activity", "checksum": {"name": "sha256", "checksum": "5dd5c63e965298b958cce33415a0b3500ec70f1b538c7508b762f3c51981f164"}, "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 == 'redshift' else false }}", "column_types": {"timestamp": "timestamp"}}, "created_at": 1671120128.5586472, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation_recipient_activity\""}, "seed.mailchimp_source_integration_tests.campaign": {"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", "create_time": "timestamp", "send_time": "timestamp"}, "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": "postgres", "schema": "mailchimp_source_integration_tests", "fqn": ["mailchimp_source_integration_tests", "campaign"], "unique_id": "seed.mailchimp_source_integration_tests.campaign", "raw_code": "", "language": "sql", "package_name": "mailchimp_source_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests", "path": "campaign.csv", "original_file_path": "seeds/campaign.csv", "name": "campaign", "alias": "campaign", "checksum": {"name": "sha256", "checksum": "98d8ba020771581b82e24861b32ffa9df8bece7edec5782fc6c64d5475cfdb58"}, "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 == 'redshift' else false }}", "column_types": {"create_time": "timestamp", "send_time": "timestamp"}}, "created_at": 1671120128.5599911, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"campaign\""}, "model.mailchimp_source.stg_mailchimp__segments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segments"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments", "raw_code": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segments_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segments_tmp')),\n staging_columns=get_segment_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__segments.sql", "original_file_path": "models/stg_mailchimp__segments.sql", "name": "stg_mailchimp__segments", "alias": "stg_mailchimp__segments", "checksum": {"name": "sha256", "checksum": "9a541d259b8016fe2430ed426ebf18b892a675e034a30ad5c0ac1b53337e5d8d"}, "tags": [], "refs": [["stg_mailchimp__segments_tmp"], ["stg_mailchimp__segments_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a segment in Mailchimp.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_name": {"name": "segment_name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_type": {"name": "segment_type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_timestamp": {"name": "updated_timestamp", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1671120128.864456, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segments_tmp\"\n\n),\n\n\nfields as (\n\n select\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 \n \n created_at\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_count\n \n as \n \n member_count\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n id as segment_id,\n list_id,\n member_count,\n name as segment_name,\n type as segment_type,\n updated_at as updated_timestamp,\n created_at as created_timestamp\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segments\""}, "model.mailchimp_source.stg_mailchimp__campaign_recipients": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_recipients_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_recipients_tmp')),\n staging_columns=get_campaign_recipient_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__campaign_recipients.sql", "original_file_path": "models/stg_mailchimp__campaign_recipients.sql", "name": "stg_mailchimp__campaign_recipients", "alias": "stg_mailchimp__campaign_recipients", "checksum": {"name": "sha256", "checksum": "4decd6eec363a2db2497b98f46bd54776b55aec6a96dcbfe65bf535eaeae4c70"}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients_tmp"], ["stg_mailchimp__campaign_recipients_tmp"]], "sources": [], "metrics": [], "description": "Each record represents the send of a campaign email.", "columns": {"email_id": {"name": "email_id", "description": "The surrogate key that uses table campaign_id and member_id.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1671120128.848184, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_recipients_tmp\"\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n campaign_id,\n member_id,\n combination_id,\n list_id\n from fields\n\n), \n\nunique_key as (\n\n select \n *,\n \n \nmd5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(member_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as email_id\n from final\n \n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_recipients\""}, "model.mailchimp_source.stg_mailchimp__lists": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_list_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__lists"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__lists_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__lists_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__lists.sql", "original_file_path": "models/stg_mailchimp__lists.sql", "name": "stg_mailchimp__lists", "alias": "stg_mailchimp__lists", "checksum": {"name": "sha256", "checksum": "4d6a8a6e5f037e2b841245e3006ce38a78ae09f8fb01bc3d520f81d6242f46a5"}, "tags": [], "refs": [["stg_mailchimp__lists_tmp"], ["stg_mailchimp__lists_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a list in Mailchimp.", "columns": {"list_id": {"name": "list_id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__lists.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1671120128.8590999, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__lists_tmp\"\n\n),\n\n\nfields as (\n\n select\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 beamer_address\n \n as \n \n beamer_address\n \n, \n \n \n contact_address_1\n \n as \n \n contact_address_1\n \n, \n \n \n contact_address_2\n \n as \n \n contact_address_2\n \n, \n \n \n contact_city\n \n as \n \n contact_city\n \n, \n \n \n contact_company\n \n as \n \n contact_company\n \n, \n \n \n contact_country\n \n as \n \n contact_country\n \n, \n \n \n contact_state\n \n as \n \n contact_state\n \n, \n \n \n contact_zip\n \n as \n \n contact_zip\n \n, \n \n \n date_created\n \n as \n \n date_created\n \n, \n \n \n default_from_email\n \n as \n \n default_from_email\n \n, \n \n \n default_from_name\n \n as \n \n default_from_name\n \n, \n \n \n default_language\n \n as \n \n default_language\n \n, \n \n \n default_subject\n \n as \n \n default_subject\n \n, \n \n \n email_type_option\n \n as \n \n email_type_option\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_rating\n \n as \n \n list_rating\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n notify_on_subscribe\n \n as \n \n notify_on_subscribe\n \n, \n \n \n notify_on_unsubscribe\n \n as \n \n notify_on_unsubscribe\n \n, \n \n \n permission_reminder\n \n as \n \n permission_reminder\n \n, \n \n \n subscribe_url_long\n \n as \n \n subscribe_url_long\n \n, \n \n \n subscribe_url_short\n \n as \n \n subscribe_url_short\n \n, \n \n \n use_archive_bar\n \n as \n \n use_archive_bar\n \n, \n \n \n visibility\n \n as \n \n visibility\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n id as list_id,\n date_created,\n name,\n list_rating,\n beamer_address,\n contact_address_1,\n contact_address_2,\n contact_city,\n contact_company,\n contact_country,\n contact_state,\n contact_zip,\n default_from_email,\n default_from_name,\n default_language,\n default_subject,\n email_type_option,\n notify_on_subscribe,\n notify_on_unsubscribe,\n permission_reminder,\n subscribe_url_long,\n subscribe_url_short,\n use_archive_bar,\n visibility\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__lists\""}, "model.mailchimp_source.stg_mailchimp__automation_activities": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_activities_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_activities_tmp')),\n staging_columns=get_automation_recipient_activity_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.generate_surrogate_key(['action_type', 'automation_email_id', 'member_id', 'activity_timestamp']) }} as activity_id\n from final\n)\n\nselect * from unique_key", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automation_activities.sql", "original_file_path": "models/stg_mailchimp__automation_activities.sql", "name": "stg_mailchimp__automation_activities", "alias": "stg_mailchimp__automation_activities", "checksum": {"name": "sha256", "checksum": "4992e107e904d1a89d829504c3a82b22223d8ecfb1ccc15ac9bc2fcf0402943a"}, "tags": [], "refs": [["stg_mailchimp__automation_activities_tmp"], ["stg_mailchimp__automation_activities_tmp"]], "sources": [], "metrics": [], "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1671120128.839081, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_activities_tmp\"\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n action as action_type,\n automation_email_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type\n from fields\n\n),\n\nunique_key as (\n\n select \n *, \n \n \nmd5(cast(coalesce(cast(action_type as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(automation_email_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(member_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(activity_timestamp as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as activity_id\n from final\n)\n\nselect * from unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_activities\""}, "model.mailchimp_source.stg_mailchimp__unsubscribes": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_unsubscribe_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__unsubscribes"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__unsubscribes_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__unsubscribes_tmp')),\n staging_columns=get_unsubscribe_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n {{ dbt_utils.generate_surrogate_key([ 'member_id', 'list_id', 'unsubscribe_timestamp']) }} as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__unsubscribes.sql", "original_file_path": "models/stg_mailchimp__unsubscribes.sql", "name": "stg_mailchimp__unsubscribes", "alias": "stg_mailchimp__unsubscribes", "checksum": {"name": "sha256", "checksum": "bbab31dfb3439a7531096fa231c677e15f727b65447947b6c4dc1db362119652"}, "tags": [], "refs": [["stg_mailchimp__unsubscribes_tmp"], ["stg_mailchimp__unsubscribes_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a member who unsubscribed.", "columns": {"unsubscribe_id": {"name": "unsubscribe_id", "description": "The surrogate key that uses table member_id, list_id, and unsubscribe_timestamp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__unsubscribes.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1671120128.865613, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__unsubscribes_tmp\"\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n reason\n \n as \n \n reason\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select \n campaign_id,\n member_id,\n list_id,\n reason as unsubscribe_reason,\n timestamp as unsubscribe_timestamp\n from fields\n\n), \n\nunique_key as (\n\n select \n *, \n \n \nmd5(cast(coalesce(cast(member_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unsubscribe_timestamp as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsubscribe_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__unsubscribes\""}, "model.mailchimp_source.stg_mailchimp__campaigns": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaigns"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaigns_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaigns_tmp')),\n staging_columns=get_campaign_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__campaigns.sql", "original_file_path": "models/stg_mailchimp__campaigns.sql", "name": "stg_mailchimp__campaigns", "alias": "stg_mailchimp__campaigns", "checksum": {"name": "sha256", "checksum": "56693d69d8c258df63e0d9bedc7606959093d93608786b62065df629537f7e96"}, "tags": [], "refs": [["stg_mailchimp__campaigns_tmp"], ["stg_mailchimp__campaigns_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a campaign in Mailchimp.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_timestamp": {"name": "create_timestamp", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to_email": {"name": "reply_to_email", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaigns.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1671120128.855427, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaigns_tmp\"\n\n),\n\n\nfields as (\n\n select\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 archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n long_archive_url\n \n as \n \n long_archive_url\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n test_size\n \n as \n \n test_size\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n, \n \n \n wait_time\n \n as \n \n wait_time\n \n, \n \n \n winner_criteria\n \n as \n \n winner_criteria\n \n, \n \n \n winning_campaign_id\n \n as \n \n winning_campaign_id\n \n, \n \n \n winning_combination_id\n \n as \n \n winning_combination_id\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as campaign_id,\n segment_id,\n create_time as create_timestamp,\n send_time as send_timestamp, \n list_id,\n reply_to as reply_to_email,\n type as campaign_type,\n title,\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n from_name,\n google_analytics,\n inline_css,\n long_archive_url,\n status,\n subject_line,\n template_id,\n test_size,\n timewarp,\n to_name,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation,\n wait_time,\n winner_criteria,\n winning_campaign_id,\n winning_combination_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaigns\""}, "model.mailchimp_source.stg_mailchimp__automations": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automations"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__automations_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automations_tmp')),\n staging_columns=get_automation_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automations.sql", "original_file_path": "models/stg_mailchimp__automations.sql", "name": "stg_mailchimp__automations", "alias": "stg_mailchimp__automations", "checksum": {"name": "sha256", "checksum": "d53e4be91338f237ad9434b3962987eea297a7259b2109096f46c8a04df49144"}, "tags": [], "refs": [["stg_mailchimp__automations_tmp"], ["stg_mailchimp__automations_tmp"]], "sources": [], "metrics": [], "description": "Each record represents an automation in Mailchimp.", "columns": {"automation_id": {"name": "automation_id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automations.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1671120128.847241, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automations_tmp\"\n\n),\n\nfields as (\n\n select\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 create_time\n \n as \n \n create_time\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n, \n \n \n segment_text\n \n as \n \n segment_text\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n trigger_settings\n \n as \n \n trigger_settings\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select\n id as automation_id,\n list_id,\n segment_id, \n segment_text,\n start_time as started_timestamp,\n create_time as created_timestamp,\n status,\n title,\n trigger_settings\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automations\""}, "model.mailchimp_source.stg_mailchimp__automation_emails": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_email_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_emails"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_emails_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_emails_tmp')),\n staging_columns=get_automation_email_columns()\n )\n }}\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automation_emails.sql", "original_file_path": "models/stg_mailchimp__automation_emails.sql", "name": "stg_mailchimp__automation_emails", "alias": "stg_mailchimp__automation_emails", "checksum": {"name": "sha256", "checksum": "d4a7ad6a314a52074f4cc4486a63f7f1f1f9bf7b89605427d38c10fa33bf9f38"}, "tags": [], "refs": [["stg_mailchimp__automation_emails_tmp"], ["stg_mailchimp__automation_emails_tmp"]], "sources": [], "metrics": [], "description": "Each record represents an automation email (that make up automations).", "columns": {"automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_timestamp": {"name": "created_timestamp", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "started_timestamp": {"name": "started_timestamp", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_timestamp": {"name": "send_timestamp", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_emails.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1671120128.8448682, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_emails_tmp\"\n\n), \n\nfields as (\n\n select \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 archive_url\n \n as \n \n archive_url\n \n, \n \n \n authenticate\n \n as \n \n authenticate\n \n, \n \n \n auto_footer\n \n as \n \n auto_footer\n \n, \n \n \n auto_tweet\n \n as \n \n auto_tweet\n \n, \n \n \n automation_id\n \n as \n \n automation_id\n \n, \n \n \n clicktale\n \n as \n \n clicktale\n \n, \n \n \n content_type\n \n as \n \n content_type\n \n, \n \n \n create_time\n \n as \n \n create_time\n \n, \n \n \n delay_action\n \n as \n \n delay_action\n \n, \n \n \n delay_action_description\n \n as \n \n delay_action_description\n \n, \n \n \n delay_amount\n \n as \n \n delay_amount\n \n, \n \n \n delay_direction\n \n as \n \n delay_direction\n \n, \n \n \n delay_full_description\n \n as \n \n delay_full_description\n \n, \n \n \n delay_type\n \n as \n \n delay_type\n \n, \n \n \n drag_and_drop\n \n as \n \n drag_and_drop\n \n, \n \n \n fb_comments\n \n as \n \n fb_comments\n \n, \n \n \n folder_id\n \n as \n \n folder_id\n \n, \n \n \n from_name\n \n as \n \n from_name\n \n, \n \n \n google_analytics\n \n as \n \n google_analytics\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n inline_css\n \n as \n \n inline_css\n \n, \n \n \n position\n \n as \n \n position\n \n, \n \n \n reply_to\n \n as \n \n reply_to\n \n, \n \n \n send_time\n \n as \n \n send_time\n \n, \n \n \n start_time\n \n as \n \n start_time\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject_line\n \n as \n \n subject_line\n \n, \n \n \n template_id\n \n as \n \n template_id\n \n, \n \n \n timewarp\n \n as \n \n timewarp\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n to_name\n \n as \n \n to_name\n \n, \n \n \n track_ecomm_360\n \n as \n \n track_ecomm_360\n \n, \n \n \n track_goals\n \n as \n \n track_goals\n \n, \n \n \n track_html_clicks\n \n as \n \n track_html_clicks\n \n, \n \n \n track_opens\n \n as \n \n track_opens\n \n, \n \n \n track_text_clicks\n \n as \n \n track_text_clicks\n \n, \n \n \n use_conversation\n \n as \n \n use_conversation\n \n\n\n\n \n from base \n\n), \n\nfinal as (\n\n select\n -- IDs and standard timestamp\n id as automation_email_id,\n automation_id,\n create_time as created_timestamp,\n start_time as started_timestamp,\n send_time as send_timestamp,\n\n -- email details\n from_name,\n reply_to,\n status,\n subject_line,\n title,\n to_name,\n\n archive_url,\n authenticate,\n auto_footer,\n auto_tweet,\n clicktale,\n content_type,\n delay_action,\n delay_action_description,\n delay_amount,\n delay_direction,\n delay_full_description,\n delay_type,\n drag_and_drop,\n fb_comments,\n folder_id,\n google_analytics,\n inline_css,\n position,\n template_id,\n timewarp,\n track_ecomm_360,\n track_goals,\n track_html_clicks,\n track_opens,\n track_text_clicks,\n use_conversation\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_emails\""}, "model.mailchimp_source.stg_mailchimp__automation_recipients": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_automation_recipient_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__automation_recipients"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_mailchimp__automation_recipients_tmp')}}\n\n), \n\nfields as (\n\n select \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__automation_recipients_tmp')),\n staging_columns=get_automation_recipient_columns()\n )\n }}\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(['member_id','automation_email_id']) }} as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__automation_recipients.sql", "original_file_path": "models/stg_mailchimp__automation_recipients.sql", "name": "stg_mailchimp__automation_recipients", "alias": "stg_mailchimp__automation_recipients", "checksum": {"name": "sha256", "checksum": "7579dd911bab9ac42a611ce7d68d602d504a3ba7a504c1a853fe223f48f03f28"}, "tags": [], "refs": [["stg_mailchimp__automation_recipients_tmp"], ["stg_mailchimp__automation_recipients_tmp"]], "sources": [], "metrics": [], "description": "Each record represents info about the recipient of each automation.", "columns": {"automation_recipient_id": {"name": "automation_recipient_id", "description": "Surrogate key that uses member_id and automation_email_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__automation_recipients.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1671120128.845675, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_recipients_tmp\"\n\n), \n\nfields as (\n\n select \n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n automation_email_id\n \n as \n \n automation_email_id\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n\n\n\n \n from base\n\n), \n\n\nfinal as (\n\n select\n member_id,\n automation_email_id,\n list_id\n from fields\n\n),\n\n unique_key as (\n\n select \n *,\n \n \nmd5(cast(coalesce(cast(member_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(automation_email_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as automation_recipient_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_recipients\""}, "model.mailchimp_source.stg_mailchimp__members": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_member_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__members"], "unique_id": "model.mailchimp_source.stg_mailchimp__members", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__members_tmp')),\n staging_columns=get_member_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n {{ fivetran_utils.fill_pass_through_columns('mailchimp__members_pass_through_columns') }}\n \n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__members.sql", "original_file_path": "models/stg_mailchimp__members.sql", "name": "stg_mailchimp__members", "alias": "stg_mailchimp__members", "checksum": {"name": "sha256", "checksum": "0f1845646b840c30faa0cd9a863899b592ca5cb9307fba2e81829fc85aa038a0"}, "tags": [], "refs": [["stg_mailchimp__members_tmp"], ["stg_mailchimp__members_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a member in Mailchimp.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_timestamp": {"name": "signup_timestamp", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_timestamp": {"name": "opt_in_timestamp", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed_timestamp": {"name": "last_changed_timestamp", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "opt_in_ip_address": {"name": "opt_in_ip_address", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "signup_ip_address": {"name": "signup_ip_address", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1671120128.862319, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__members_tmp\"\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n dstoff\n \n as \n \n dstoff\n \n, \n \n \n email_address\n \n as \n \n email_address\n \n, \n \n \n email_client\n \n as \n \n email_client\n \n, \n \n \n email_type\n \n as \n \n email_type\n \n, \n \n \n gmtoff\n \n as \n \n gmtoff\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n ip_opt\n \n as \n \n ip_opt\n \n, \n \n \n ip_signup\n \n as \n \n ip_signup\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n last_changed\n \n as \n \n last_changed\n \n, \n \n \n latitude\n \n as \n \n latitude\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n longitude\n \n as \n \n longitude\n \n, \n \n \n member_rating\n \n as \n \n member_rating\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n timestamp_opt\n \n as \n \n timestamp_opt\n \n, \n \n \n timestamp_signup\n \n as \n \n timestamp_signup\n \n, \n \n \n timezone\n \n as \n \n timezone\n \n, \n \n \n unique_email_id\n \n as \n \n unique_email_id\n \n, \n \n \n vip\n \n as \n \n vip\n \n\n\n\n \n from base\n),\n\nfinal as (\n\n select \n id as member_id,\n email_address,\n email_client,\n email_type,\n status,\n list_id,\n timestamp_signup as signup_timestamp,\n timestamp_opt as opt_in_timestamp,\n last_changed as last_changed_timestamp,\n country_code,\n dstoff,\n gmtoff,\n ip_opt as opt_in_ip_address,\n ip_signup as signup_ip_address,\n language,\n latitude,\n longitude,\n member_rating,\n timezone,\n unique_email_id,\n vip\n \n --The below macro adds the fields defined within your mailchimp__member_pass_through_columns variable into the staging model\n \n\n\n\n\n \n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__members\""}, "model.mailchimp_source.stg_mailchimp__campaign_activities": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_campaign_recipient_activity_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__campaign_activities"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_mailchimp__campaign_activities_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__campaign_activities_tmp')),\n staging_columns=get_campaign_recipient_activity_columns()\n )\n }}\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n {{ dbt_utils.generate_surrogate_key(['action_type', 'campaign_id', 'member_id', 'activity_timestamp']) }} as activity_id,\n {{ dbt_utils.generate_surrogate_key(['campaign_id','member_id']) }} as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__campaign_activities.sql", "original_file_path": "models/stg_mailchimp__campaign_activities.sql", "name": "stg_mailchimp__campaign_activities", "alias": "stg_mailchimp__campaign_activities", "checksum": {"name": "sha256", "checksum": "addaaaf9c7478fc306ee13cd67dac65b91b5c202313430064063b33e5ca88908"}, "tags": [], "refs": [["stg_mailchimp__campaign_activities_tmp"], ["stg_mailchimp__campaign_activities_tmp"]], "sources": [], "metrics": [], "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"activity_id": {"name": "activity_id", "description": "The ID of the activity/event.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "action_type": {"name": "action_type", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "activity_timestamp": {"name": "activity_timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_address": {"name": "ip_address", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_id": {"name": "email_id", "description": "The ID of the email sent. (Created in dbt, not Mailchimp.)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__campaign_activities.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp"}, "created_at": 1671120128.850026, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_activities_tmp\"\n\n),\n\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n action\n \n as \n \n action\n \n, \n \n \n bounce_type\n \n as \n \n bounce_type\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n combination_id\n \n as \n \n combination_id\n \n, \n \n \n ip\n \n as \n \n ip\n \n, \n \n \n list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n timestamp\n \n as \n \n timestamp\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n \n from base\n),\n\n\nfinal as (\n\n select \n action as action_type,\n campaign_id,\n member_id,\n list_id,\n timestamp as activity_timestamp,\n ip as ip_address,\n url,\n bounce_type,\n combination_id\n from fields\n\n), unique_key as (\n\n select \n *, \n \n \nmd5(cast(coalesce(cast(action_type as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(member_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(activity_timestamp as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as activity_id,\n \n \nmd5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(member_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as email_id\n from final\n\n)\n\nselect *\nfrom unique_key", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_activities\""}, "model.mailchimp_source.stg_mailchimp__segment_members": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.mailchimp_source.get_segment_member_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "stg_mailchimp__segment_members"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members", "raw_code": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_mailchimp__segment_members_tmp') }}\n\n),\n\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_mailchimp__segment_members_tmp')),\n staging_columns=get_segment_member_columns()\n )\n }}\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "stg_mailchimp__segment_members.sql", "original_file_path": "models/stg_mailchimp__segment_members.sql", "name": "stg_mailchimp__segment_members", "alias": "stg_mailchimp__segment_members", "checksum": {"name": "sha256", "checksum": "86acbc06483f991f2e5a9f970cc458041efbc105b949237f707432ed6c354c35"}, "tags": [], "refs": [["stg_mailchimp__segment_members_tmp"], ["stg_mailchimp__segment_members_tmp"]], "sources": [], "metrics": [], "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "mailchimp_source://models/stg_mailchimp.yml", "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp__segment_members.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "enabled": true}, "created_at": 1671120128.863186, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segment_members_tmp\"\n\n),\n\n\nfields as (\n\n select\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 list_id\n \n as \n \n list_id\n \n, \n \n \n member_id\n \n as \n \n member_id\n \n, \n \n \n segment_id\n \n as \n \n segment_id\n \n\n\n\n \n from base\n\n), \n\nfinal as (\n\n select\n segment_id,\n member_id,\n list_id\n from fields\n\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segment_members\""}, "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient_activity"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient_activity') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automation_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_activities_tmp.sql", "name": "stg_mailchimp__automation_activities_tmp", "alias": "stg_mailchimp__automation_activities_tmp", "checksum": {"name": "sha256", "checksum": "99dd3be31bece932a946f44c80ffe85b9b21d998ddaf1d7a4fb9108f9b4f3566"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient_activity"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1671120128.717825, "compiled_code": "\n\nselect * from \"postgres\".\"mailchimp_source_integration_tests\".\"automation_recipient_activity\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_activities_tmp\""}, "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.unsubscribe"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__unsubscribes_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "raw_code": "select * from {{ var('unsubscribe') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__unsubscribes_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "name": "stg_mailchimp__unsubscribes_tmp", "alias": "stg_mailchimp__unsubscribes_tmp", "checksum": {"name": "sha256", "checksum": "49ddeb7631aa624011d6fd5f608b80fa284ca6443a837c941d31cc864e99efca"}, "tags": [], "refs": [], "sources": [["mailchimp", "unsubscribe"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__unsubscribes_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1671120128.723299, "compiled_code": "select * from \"postgres\".\"mailchimp_source_integration_tests\".\"unsubscribe\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__unsubscribes_tmp\""}, "model.mailchimp_source.stg_mailchimp__lists_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.list"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__lists_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp", "raw_code": "select * from {{ var('list') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__lists_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__lists_tmp.sql", "name": "stg_mailchimp__lists_tmp", "alias": "stg_mailchimp__lists_tmp", "checksum": {"name": "sha256", "checksum": "f2334dfd1f22372c81a53cb1903dc8accef34fbf98c0a3477bd0ca373cffd83d"}, "tags": [], "refs": [], "sources": [["mailchimp", "list"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__lists_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1671120128.7268429, "compiled_code": "select * from \"postgres\".\"mailchimp_source_integration_tests\".\"list\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__lists_tmp\""}, "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "raw_code": "select * from {{ var('campaign_recipient') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "name": "stg_mailchimp__campaign_recipients_tmp", "alias": "stg_mailchimp__campaign_recipients_tmp", "checksum": {"name": "sha256", "checksum": "6208dd636a377fb8462ee7838ec92a9b3592f5861f42c6dd803aa8c32e6fe3f5"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1671120128.73011, "compiled_code": "select * from \"postgres\".\"mailchimp_source_integration_tests\".\"campaign_recipient\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_recipients_tmp\""}, "model.mailchimp_source.stg_mailchimp__segments_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segments_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp", "raw_code": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('mailchimp_segment') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__segments_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segments_tmp.sql", "name": "stg_mailchimp__segments_tmp", "alias": "stg_mailchimp__segments_tmp", "checksum": {"name": "sha256", "checksum": "4235011fcab4cb786bf93907ba23fa09882a56e9430b6fc13bf0425c2cb5cc09"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segments_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1671120128.733471, "compiled_code": "\n\nselect * from \"postgres\".\"mailchimp_source_integration_tests\".\"segment\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segments_tmp\""}, "model.mailchimp_source.stg_mailchimp__campaigns_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaigns_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp", "raw_code": "select * from {{ var('campaign') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__campaigns_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaigns_tmp.sql", "name": "stg_mailchimp__campaigns_tmp", "alias": "stg_mailchimp__campaigns_tmp", "checksum": {"name": "sha256", "checksum": "b96a24c9964cf05208bd2a9e0d0ce0455a507b9f07026887f777922df4942cd9"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaigns_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1671120128.737269, "compiled_code": "select * from \"postgres\".\"mailchimp_source_integration_tests\".\"campaign\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaigns_tmp\""}, "model.mailchimp_source.stg_mailchimp__segment_members_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.segment_member"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__segment_members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp", "raw_code": "{{ config(enabled=var('mailchimp_using_segments', True)) }}\n\nselect * from {{ var('segment_member') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__segment_members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__segment_members_tmp.sql", "name": "stg_mailchimp__segment_members_tmp", "alias": "stg_mailchimp__segment_members_tmp", "checksum": {"name": "sha256", "checksum": "5b6ac15d76b277f0b9f4d99dab168471e7e599bf8e79bd491dc412cfd5e9b48b"}, "tags": [], "refs": [], "sources": [["mailchimp", "segment_member"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__segment_members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1671120128.741298, "compiled_code": "\n\nselect * from \"postgres\".\"mailchimp_source_integration_tests\".\"segment_member\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segment_members_tmp\""}, "model.mailchimp_source.stg_mailchimp__members_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.member"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__members_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp", "raw_code": "select * from {{ var('member') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__members_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__members_tmp.sql", "name": "stg_mailchimp__members_tmp", "alias": "stg_mailchimp__members_tmp", "checksum": {"name": "sha256", "checksum": "5fe9a82d5a301c2dd82f196d47d882b6c2083528bd8b53f1a49591496b729b5e"}, "tags": [], "refs": [], "sources": [["mailchimp", "member"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__members_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1671120128.7448618, "compiled_code": "select * from \"postgres\".\"mailchimp_source_integration_tests\".\"member\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__members_tmp\""}, "model.mailchimp_source.stg_mailchimp__automations_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automations_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automations_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automations_tmp.sql", "name": "stg_mailchimp__automations_tmp", "alias": "stg_mailchimp__automations_tmp", "checksum": {"name": "sha256", "checksum": "2d97a5eacee487f94b5553490b28db0d5252d917897965fa442e884a547e78d3"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automations_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1671120128.7481432, "compiled_code": "\n\nselect * from \"postgres\".\"mailchimp_source_integration_tests\".\"automation\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automations_tmp\""}, "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_email"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_emails_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_email') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automation_emails_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_emails_tmp.sql", "name": "stg_mailchimp__automation_emails_tmp", "alias": "stg_mailchimp__automation_emails_tmp", "checksum": {"name": "sha256", "checksum": "9ee9a3419a66bfb12b2c084315fdf33a0751480aa6b206c201cfb3feca13a465"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_email"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_emails_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1671120128.751704, "compiled_code": "\n\nselect * from \"postgres\".\"mailchimp_source_integration_tests\".\"automation_email\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_emails_tmp\""}, "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.automation_recipient"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__automation_recipients_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "raw_code": "{{ config(enabled=var('mailchimp_using_automations', True)) }}\n\nselect * from {{ var('automation_recipient') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__automation_recipients_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "name": "stg_mailchimp__automation_recipients_tmp", "alias": "stg_mailchimp__automation_recipients_tmp", "checksum": {"name": "sha256", "checksum": "28eeb5e9f065dcf688d7bff8b450ba06adb13628fe476e0091d49740ed8b1241"}, "tags": [], "refs": [], "sources": [["mailchimp", "automation_recipient"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__automation_recipients_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view", "enabled": true}, "created_at": 1671120128.7552042, "compiled_code": "\n\nselect * from \"postgres\".\"mailchimp_source_integration_tests\".\"automation_recipient\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_recipients_tmp\""}, "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"]}, "config": {"enabled": true, "alias": null, "schema": "stg_mailchimp", "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}, "materalized": "view", "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "mailchimp_source_integration_tests_stg_mailchimp", "fqn": ["mailchimp_source", "tmp", "stg_mailchimp__campaign_activities_tmp"], "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "raw_code": "select * from {{ var('campaign_recipient_activity') }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "tmp/stg_mailchimp__campaign_activities_tmp.sql", "original_file_path": "models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "name": "stg_mailchimp__campaign_activities_tmp", "alias": "stg_mailchimp__campaign_activities_tmp", "checksum": {"name": "sha256", "checksum": "50e7e9bdfd1bded394388edd76798d6b59b30bbfac7181e2e108401c179c9e78"}, "tags": [], "refs": [], "sources": [["mailchimp", "campaign_recipient_activity"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/tmp/stg_mailchimp__campaign_activities_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_mailchimp", "materalized": "view"}, "created_at": 1671120128.758844, "compiled_code": "select * from \"postgres\".\"mailchimp_source_integration_tests\".\"campaign_recipient_activity\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_activities_tmp\""}, "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_activities_activity_id", "alias": "not_null_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.8697999, "compiled_code": "\n \n \n\n\n\nselect activity_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_activities\"\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__automation_activities"}, "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automation_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automation_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_activities_activity_id", "alias": "unique_stg_mailchimp__automation_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_activities"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automation_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.870927, "compiled_code": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_activities\"\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__automation_activities"}, "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_emails')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_emails_automation_email_id", "alias": "unique_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.8719418, "compiled_code": "\n \n \n\nselect\n automation_email_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_emails\"\nwhere automation_email_id is not null\ngroup by automation_email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id", "file_key_name": "models.stg_mailchimp__automation_emails"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_emails')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_emails"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automation_emails_automation_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_emails_automation_email_id", "alias": "not_null_stg_mailchimp__automation_emails_automation_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_emails"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automation_emails_automation_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.872936, "compiled_code": "\n \n \n\n\n\nselect automation_email_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_emails\"\nwhere automation_email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_email_id", "file_key_name": "models.stg_mailchimp__automation_emails"}, "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_recipient_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "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": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154\") }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_stg_mailchimp__automa_1703f36d68ebe81feee15564aa486154"}, "created_at": 1671120128.874069, "compiled_code": "\n \n \n\n\n\nselect automation_recipient_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_recipients\"\nwhere automation_recipient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id", "file_key_name": "models.stg_mailchimp__automation_recipients"}, "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_recipient_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automation_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automation_recipients"]}, "config": {"enabled": true, "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "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": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automation_recipients_automation_recipient_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db\") }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automation_recipients_automation_recipient_id", "alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automation_recipients"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_stg_mailchimp__automati_827bdb776e9d61d72a3220bd2e2b43db"}, "created_at": 1671120128.875051, "compiled_code": "\n \n \n\nselect\n automation_recipient_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automation_recipients\"\nwhere automation_recipient_id is not null\ngroup by automation_recipient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_recipient_id", "file_key_name": "models.stg_mailchimp__automation_recipients"}, "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "automation_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automations')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__automations_automation_id", "alias": "unique_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automations"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.876024, "compiled_code": "\n \n \n\nselect\n automation_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automations\"\nwhere automation_id is not null\ngroup by automation_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id", "file_key_name": "models.stg_mailchimp__automations"}, "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "automation_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__automations')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__automations"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__automations_automation_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__automations_automation_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__automations_automation_id", "alias": "not_null_stg_mailchimp__automations_automation_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__automations"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__automations_automation_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.876998, "compiled_code": "\n \n \n\n\n\nselect automation_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__automations\"\nwhere automation_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "automation_id", "file_key_name": "models.stg_mailchimp__automations"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_recipients_email_id", "alias": "unique_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.878272, "compiled_code": "\n \n \n\nselect\n email_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_recipients\"\nwhere email_id is not null\ngroup by email_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id", "file_key_name": "models.stg_mailchimp__campaign_recipients"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "email_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_recipients')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__campaign_recipients_email_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__campaign_recipients_email_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_recipients_email_id", "alias": "not_null_stg_mailchimp__campaign_recipients_email_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_recipients"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__campaign_recipients_email_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.879242, "compiled_code": "\n \n \n\n\n\nselect email_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_recipients\"\nwhere email_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "email_id", "file_key_name": "models.stg_mailchimp__campaign_recipients"}, "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaign_activities_activity_id", "alias": "unique_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.88021, "compiled_code": "\n \n \n\nselect\n activity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_activities\"\nwhere activity_id is not null\ngroup by activity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__campaign_activities"}, "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "activity_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaign_activities')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaign_activities"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__campaign_activities_activity_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__campaign_activities_activity_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaign_activities_activity_id", "alias": "not_null_stg_mailchimp__campaign_activities_activity_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaign_activities"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__campaign_activities_activity_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.8811882, "compiled_code": "\n \n \n\n\n\nselect activity_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaign_activities\"\nwhere activity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "activity_id", "file_key_name": "models.stg_mailchimp__campaign_activities"}, "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaigns')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__campaigns_campaign_id", "alias": "unique_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.882297, "compiled_code": "\n \n \n\nselect\n campaign_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaigns\"\nwhere campaign_id is not null\ngroup by campaign_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_mailchimp__campaigns"}, "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__campaigns')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__campaigns"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__campaigns_campaign_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__campaigns_campaign_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__campaigns_campaign_id", "alias": "not_null_stg_mailchimp__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__campaigns"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__campaigns_campaign_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.88329, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "campaign_id", "file_key_name": "models.stg_mailchimp__campaigns"}, "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__lists')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__lists_list_id", "alias": "unique_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__lists"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.884237, "compiled_code": "\n \n \n\nselect\n list_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__lists\"\nwhere list_id is not null\ngroup by list_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id", "file_key_name": "models.stg_mailchimp__lists"}, "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__lists')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__lists"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__lists_list_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__lists_list_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__lists_list_id", "alias": "not_null_stg_mailchimp__lists_list_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__lists"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__lists_list_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.885188, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__lists\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "list_id", "file_key_name": "models.stg_mailchimp__lists"}, "test.mailchimp_source.unique_stg_mailchimp__members_member_id.cb23726c11": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "member_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__members_member_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_member_id.cb23726c11", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__members_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__members_member_id", "alias": "unique_stg_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__members"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.886254, "compiled_code": "\n \n \n\nselect\n member_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__members\"\nwhere member_id is not null\ngroup by member_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id", "file_key_name": "models.stg_mailchimp__members"}, "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.70b6c824fb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "member_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__members')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__members_member_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.70b6c824fb", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__members_member_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__members_member_id", "alias": "not_null_stg_mailchimp__members_member_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__members"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__members_member_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.8872051, "compiled_code": "\n \n \n\n\n\nselect member_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__members\"\nwhere member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "member_id", "file_key_name": "models.stg_mailchimp__members"}, "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "segment_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__segments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__segments_segment_id", "alias": "unique_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__segments"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.888171, "compiled_code": "\n \n \n\nselect\n segment_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segments\"\nwhere segment_id is not null\ngroup by segment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id", "file_key_name": "models.stg_mailchimp__segments"}, "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "segment_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__segments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__segments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__segments_segment_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__segments_segment_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__segments_segment_id", "alias": "not_null_stg_mailchimp__segments_segment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__segments"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__segments_segment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.889132, "compiled_code": "\n \n \n\n\n\nselect segment_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__segments\"\nwhere segment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "segment_id", "file_key_name": "models.stg_mailchimp__segments"}, "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "unsubscribe_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__unsubscribes')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "not_null_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "not_null_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/not_null_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.8902578, "compiled_code": "\n \n \n\n\n\nselect unsubscribe_id\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__unsubscribes\"\nwhere unsubscribe_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id", "file_key_name": "models.stg_mailchimp__unsubscribes"}, "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "unsubscribe_id", "model": "{{ get_where_subquery(ref('stg_mailchimp__unsubscribes')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.mailchimp_source.stg_mailchimp__unsubscribes"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "mailchimp_source_integration_tests_dbt_test__audit", "fqn": ["mailchimp_source", "unique_stg_mailchimp__unsubscribes_unsubscribe_id"], "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "original_file_path": "models/stg_mailchimp.yml", "name": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "alias": "unique_stg_mailchimp__unsubscribes_unsubscribe_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_mailchimp__unsubscribes"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/mailchimp_source/models/stg_mailchimp.yml/unique_stg_mailchimp__unsubscribes_unsubscribe_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671120128.891288, "compiled_code": "\n \n \n\nselect\n unsubscribe_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"mailchimp_source_integration_tests_stg_mailchimp\".\"stg_mailchimp__unsubscribes\"\nwhere unsubscribe_id is not null\ngroup by unsubscribe_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "unsubscribe_id", "file_key_name": "models.stg_mailchimp__unsubscribes"}}, "sources": {"source.mailchimp_source.mailchimp.automation": {"fqn": ["mailchimp_source", "mailchimp", "automation"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.automation", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the automation in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_text": {"name": "segment_text", "description": "The field describing the Segment an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the Automation was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the Automation was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the Automation. Possible Values: save, paused, sending\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the Automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trigger_settings": {"name": "trigger_settings", "description": "Available triggers for Automation workflows.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation\"", "created_at": 1671120128.892131}, "source.mailchimp_source.mailchimp.automation_email": {"fqn": ["mailchimp_source", "mailchimp", "automation_email"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.automation_email", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_email", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_email", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an automation email (that make up automations).", "columns": {"id": {"name": "id", "description": "The ID of the email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_id": {"name": "automation_id", "description": "The ID of the automation an email relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the automation email was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_time": {"name": "start_time", "description": "The date and time the automation email was started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time the automation email was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the automation email (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the automation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The automation email's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the automation email's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the automation email. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the automation email archive page when the automation email is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action": {"name": "delay_action", "description": "The action that triggers the delay of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_action_description": {"name": "delay_action_description", "description": "The user-friendly description of the action that triggers an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_amount": {"name": "delay_amount", "description": "The delay amount for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_direction": {"name": "delay_direction", "description": "Whether the delay settings describe before or after the delay action of an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_full_description": {"name": "delay_full_description", "description": "The user-friendly description of the delay and trigger action settings for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "delay_type": {"name": "delay_type", "description": "The type of delay for an Automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the automation email uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the automation email is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the automation email content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "position": {"name": "position", "description": "The position of an Automation email in a workflow.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this automation email using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation_email\"", "created_at": 1671120128.8922648}, "source.mailchimp_source.mailchimp.automation_recipient": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents info about the recipient of each automation.", "columns": {"member_id": {"name": "member_id", "description": "The ID of the member the automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List an automation was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation_recipient\"", "created_at": 1671120128.892333}, "source.mailchimp_source.mailchimp.automation_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "automation_recipient_activity"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.automation_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "automation_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "automation_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a automation email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "automation_email_id": {"name": "automation_email_id", "description": "The ID for the automation email that relates to the activity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"automation_recipient_activity\"", "created_at": 1671120128.892401}, "source.mailchimp_source.mailchimp.campaign": {"fqn": ["mailchimp_source", "mailchimp", "campaign"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.campaign", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a campaign in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID of the campaign in Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "segment_id": {"name": "segment_id", "description": "The ID of the Segment a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "The date and time the campaign was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "send_time": {"name": "send_time", "description": "The date and time a campaign was sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List a campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reply_to": {"name": "reply_to", "description": "The reply-to email address for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "archive_url": {"name": "archive_url", "description": "The link to the campaign's archive version in ISO 8601 format.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "authenticate": {"name": "authenticate", "description": "Whether Mailchimp authenticated the campaign. Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_footer": {"name": "auto_footer", "description": "Automatically append Mailchimp's default footer to the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auto_tweet": {"name": "auto_tweet", "description": "Automatically tweet a link to the campaign archive page when the campaign is sent.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clicktale": {"name": "clicktale", "description": "The custom slug for ClickTale tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "content_type": {"name": "content_type", "description": "How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drag_and_drop": {"name": "drag_and_drop", "description": "Whether the campaign uses the drag-and-drop editor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "fb_comments": {"name": "fb_comments", "description": "Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "folder_id": {"name": "folder_id", "description": "If the campaign is listed in a folder, the ID for that folder.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "from_name": {"name": "from_name", "description": "The 'from' name on the campaign (not an email address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "google_analytics": {"name": "google_analytics", "description": "The custom slug for Google Analytics tracking (max of 50 bytes).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inline_css": {"name": "inline_css", "description": "Automatically inline the CSS included with the campaign content.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "long_archive_url": {"name": "long_archive_url", "description": "The original link to the campaign's archive version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The current status of the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subject_line": {"name": "subject_line", "description": "The subject line for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "template_id": {"name": "template_id", "description": "The ID for the template used in this campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_size": {"name": "test_size", "description": "The percentage of recipients to send the test combinations to, must be a value between 10 and 100.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timewarp": {"name": "timewarp", "description": "Send this campaign using Timewarpe_this", "meta": {}, "data_type": null, "quote": null, "tags": []}, "to_name": {"name": "to_name", "description": "The campaign's custom 'To' name. Typically the first name merge field.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_ecomm_360": {"name": "track_ecomm_360", "description": "Whether to enable eCommerce360 tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_goals": {"name": "track_goals", "description": "Whether to enable Goal tracking.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_html_clicks": {"name": "track_html_clicks", "description": "Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_opens": {"name": "track_opens", "description": "Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "track_text_clicks": {"name": "track_text_clicks", "description": "Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_conversation": {"name": "use_conversation", "description": "Use Mailchimp Conversation feature to manage out-of-office replies.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "wait_time": {"name": "wait_time", "description": "The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winner_criteria": {"name": "winner_criteria", "description": "The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue\u2014or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_campaign_id": {"name": "winning_campaign_id", "description": "ID of the campaign that was sent to the remaining recipients based on the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "winning_combination_id": {"name": "winning_combination_id", "description": "ID for the winning combination.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"campaign\"", "created_at": 1671120128.892499}, "source.mailchimp_source.mailchimp.campaign_recipient": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents the send of a campaign email.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The ID of the campaign a sent email is from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the campaign was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"campaign_recipient\"", "created_at": 1671120128.892564}, "source.mailchimp_source.mailchimp.campaign_recipient_activity": {"fqn": ["mailchimp_source", "mailchimp", "campaign_recipient_activity"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.campaign_recipient_activity", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "campaign_recipient_activity", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "campaign_recipient_activity", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents an activity taken in relation to a campaign email.", "columns": {"action": {"name": "action", "description": "One of the following actions: 'open', 'click', or 'bounce'\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The unique ID for the sent campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member the activity relates to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The timestamp when the activity occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip": {"name": "ip", "description": "The IP address recorded for the action.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "If the action is a 'click', the URL on which the member clicked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bounce_type": {"name": "bounce_type", "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "combination_id": {"name": "combination_id", "description": "The ID of the combination the member was part of for a campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"campaign_recipient_activity\"", "created_at": 1671120128.892632}, "source.mailchimp_source.mailchimp.segment": {"fqn": ["mailchimp_source", "mailchimp", "segment"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.segment", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a segment in Mailchimp.", "columns": {"id": {"name": "id", "description": "The ID for the Segment from Mailchimp", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_count": {"name": "member_count", "description": "The number of members in the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the segment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of segment", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "The date and time the segment was last updated.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The date and time the segment was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"segment\"", "created_at": 1671120128.892701}, "source.mailchimp_source.mailchimp.segment_member": {"fqn": ["mailchimp_source", "mailchimp", "segment_member"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.segment_member", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "segment_member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "segment_member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member and their segment data.", "columns": {"segment_id": {"name": "segment_id", "description": "The ID for the Segment from Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the List the segment is part of.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"segment_member\"", "created_at": 1671120128.892765}, "source.mailchimp_source.mailchimp.list": {"fqn": ["mailchimp_source", "mailchimp", "list"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.list", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "list", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "list", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a list in Mailchimp.", "columns": {"id": {"name": "id", "description": "The unique ID of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "date_created": {"name": "date_created", "description": "The date and time that a list was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_rating": {"name": "list_rating", "description": "An auto-generated activity score for the list (0-5).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "beamer_address": {"name": "beamer_address", "description": "The list's email beamer address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_1": {"name": "contact_address_1", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_address_2": {"name": "contact_address_2", "description": "The street address for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_city": {"name": "contact_city", "description": "The city for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_company": {"name": "contact_company", "description": "The company name for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_country": {"name": "contact_country", "description": "A two-character ISO3166 country code. Defaults to US if invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_state": {"name": "contact_state", "description": "The state for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "contact_zip": {"name": "contact_zip", "description": "The postal or zip code for the list contact.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_email": {"name": "default_from_email", "description": "The default from email for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_from_name": {"name": "default_from_name", "description": "The default from name for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_language": {"name": "default_language", "description": "The default language for a lists's forms.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "default_subject": {"name": "default_subject", "description": "The default subject line for campaigns sent to a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type_option": {"name": "email_type_option", "description": "Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_subscribe": {"name": "notify_on_subscribe", "description": "The email address to send subscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "notify_on_unsubscribe": {"name": "notify_on_unsubscribe", "description": "The email address to send unsubscribe notifications to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "permission_reminder": {"name": "permission_reminder", "description": "The permission reminder for a list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_long": {"name": "subscribe_url_long", "description": "The full version of a list's subscribe form (host will vary).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscribe_url_short": {"name": "subscribe_url_short", "description": "Mailchimp's EepURL shortened version of a list's subscribe form.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "use_archive_bar": {"name": "use_archive_bar", "description": "Whether campaigns for this list use the Archive Bar in archives by default.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "visibility": {"name": "visibility", "description": "Whether this list is public or private.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "Boolean that is true if the row has been soft-deleted from the source.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"list\"", "created_at": 1671120128.89285}, "source.mailchimp_source.mailchimp.member": {"fqn": ["mailchimp_source", "mailchimp", "member"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.member", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "member", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "member", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member in Mailchimp. Note that this table may contain custom metadata columns which can be passed through via `mailchimp__members_pass_through_columns`.\n", "columns": {"id": {"name": "id", "description": "The ID of the member.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_address": {"name": "email_address", "description": "Email address for a subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_client": {"name": "email_client", "description": "The list member's email client.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email_type": {"name": "email_type", "description": "Type of email this member asked to get ('html' or 'text').", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The ID of the list the member belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_signup": {"name": "timestamp_signup", "description": "The date and time the subscriber signed up for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp_opt": {"name": "timestamp_opt", "description": "The date and time the subscribe confirmed their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_changed": {"name": "last_changed", "description": "The date and time the member's info was last changed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The member's unique code for the location country.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dstoff": {"name": "dstoff", "description": "The member's offset for timezones where daylight saving time is observed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gmtoff": {"name": "gmtoff", "description": "The member's time difference in hours from GMT.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_opt": {"name": "ip_opt", "description": "The IP address the subscriber used to confirm their opt-in status.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ip_signup": {"name": "ip_signup", "description": "IP address the subscriber signed up from.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "language": {"name": "language", "description": "If set/detected, the subscriber's language.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The member's location latitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The member's location longitude.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_rating": {"name": "member_rating", "description": "Star rating for this member, between 1 and 5.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "The timezone for the member's location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "unique_email_id": {"name": "unique_email_id", "description": "An identifier for the address across all of Mailchimp.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vip": {"name": "vip", "description": "VIP status for subscriber.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"member\"", "created_at": 1671120128.892928}, "source.mailchimp_source.mailchimp.unsubscribe": {"fqn": ["mailchimp_source", "mailchimp", "unsubscribe"], "database": "postgres", "schema": "mailchimp_source_integration_tests", "unique_id": "source.mailchimp_source.mailchimp.unsubscribe", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "models/src_mailchimp.yml", "original_file_path": "models/src_mailchimp.yml", "name": "unsubscribe", "source_name": "mailchimp", "source_description": "", "loader": "fivetran", "identifier": "unsubscribe", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a member who unsubscribed.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The unique id for the campaign.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "The ID of the member an email was sent to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "list_id": {"name": "list_id", "description": "The unique ID for the list.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Field expressing unsubscribe reason.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "timestamp": {"name": "timestamp", "description": "The time and date the member unsubscribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "UTC timestamp that indicates the time when Fivetran last successfully synced the row.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"mailchimp_source_integration_tests\".\"unsubscribe\"", "created_at": 1671120128.892992}}, "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": 1671120127.9876359, "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": 1671120127.987891, "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": 1671120127.9880052, "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": 1671120127.988117, "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": 1671120127.988223, "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": 1671120127.989377, "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": 1671120127.990069, "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": 1671120127.995546, "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": 1671120127.99605, "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": 1671120127.996379, "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": 1671120127.996693, "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": 1671120127.9971561, "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": 1671120127.997588, "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": 1671120127.997762, "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": 1671120127.998112, "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": 1671120127.998494, "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": 1671120127.999347, "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": 1671120127.9995468, "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": 1671120127.999855, "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": 1671120128.000117, "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": 1671120128.000531, "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": 1671120128.0007548, "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": 1671120128.0013518, "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": 1671120128.001556, "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": 1671120128.00167, "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": 1671120128.002173, "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": 1671120128.002944, "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": 1671120128.003233, "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": 1671120128.003896, "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": 1671120128.0071301, "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": 1671120128.0073578, "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": 1671120128.007924, "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": 1671120128.0084531, "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": 1671120128.009669, "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": 1671120128.0098948, "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": 1671120128.010049, "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": 1671120128.0102248, "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": 1671120128.0103722, "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": 1671120128.010831, "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": 1671120128.01114, "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": 1671120128.0114381, "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": 1671120128.011914, "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": 1671120128.012178, "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": 1671120128.015615, "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": 1671120128.015786, "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": 1671120128.01601, "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": 1671120128.0167549, "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": 1671120128.016918, "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": 1671120128.0170949, "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": 1671120128.018456, "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": 1671120128.01985, "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": 1671120128.023621, "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": 1671120128.0239098, "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": 1671120128.0240798, "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": 1671120128.0241668, "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": 1671120128.024313, "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": 1671120128.024431, "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": 1671120128.024649, "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": 1671120128.025532, "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": 1671120128.025725, "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": 1671120128.025988, "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": 1671120128.026433, "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": 1671120128.05584, "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": 1671120128.058058, "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": 1671120128.0585878, "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": 1671120128.058899, "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": 1671120128.059343, "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": 1671120128.059875, "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": 1671120128.0616791, "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": 1671120128.06231, "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": 1671120128.063015, "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": 1671120128.063263, "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": 1671120128.064001, "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": 1671120128.068264, "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": 1671120128.069948, "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": 1671120128.070197, "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": 1671120128.0709481, "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": 1671120128.071224, "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": 1671120128.071894, "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": 1671120128.072632, "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": 1671120128.073548, "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": 1671120128.0738041, "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": 1671120128.074003, "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": 1671120128.0742762, "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": 1671120128.074464, "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": 1671120128.074741, "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": 1671120128.074937, "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": 1671120128.0752058, "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": 1671120128.075399, "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": 1671120128.075551, "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": 1671120128.075835, "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": 1671120128.080859, "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": 1671120128.0860622, "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": 1671120128.087292, "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": 1671120128.088512, "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": 1671120128.089371, "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": 1671120128.092032, "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": 1671120128.092625, "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": 1671120128.0928268, "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": 1671120128.09329, "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": 1671120128.093795, "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": 1671120128.096523, "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": 1671120128.096982, "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": 1671120128.0972202, "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": 1671120128.098793, "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": 1671120128.0992372, "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": 1671120128.0994089, "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": 1671120128.0995982, "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": 1671120128.0998778, "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": 1671120128.103241, "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": 1671120128.107934, "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": 1671120128.1088681, "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": 1671120128.1091142, "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": 1671120128.1096032, "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": 1671120128.109796, "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": 1671120128.1099288, "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": 1671120128.1100721, "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": 1671120128.110189, "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": 1671120128.110351, "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": 1671120128.110467, "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": 1671120128.11095, "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": 1671120128.111137, "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": 1671120128.1124249, "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": 1671120128.112929, "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": 1671120128.113159, "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": 1671120128.11376, "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": 1671120128.114024, "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": 1671120128.114315, "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": 1671120128.114794, "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": 1671120128.115048, "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": 1671120128.1154711, "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": 1671120128.115846, "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": 1671120128.1161642, "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": 1671120128.1167948, "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": 1671120128.118326, "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": 1671120128.118987, "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": 1671120128.11929, "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": 1671120128.121153, "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": 1671120128.122357, "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": 1671120128.123127, "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": 1671120128.123358, "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": 1671120128.123692, "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": 1671120128.123771, "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": 1671120128.124161, "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": 1671120128.124322, "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": 1671120128.1246321, "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": 1671120128.124753, "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": 1671120128.12508, "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": 1671120128.125192, "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": 1671120128.125603, "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": 1671120128.1257741, "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": 1671120128.126074, "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": 1671120128.126154, "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": 1671120128.126484, "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": 1671120128.126633, "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": 1671120128.126986, "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": 1671120128.127211, "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": 1671120128.127888, "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": 1671120128.128292, "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": 1671120128.128693, "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": 1671120128.128868, "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": 1671120128.129222, "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": 1671120128.129361, "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": 1671120128.129687, "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": 1671120128.129847, "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": 1671120128.1301591, "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": 1671120128.130322, "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": 1671120128.130643, "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": 1671120128.130753, "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": 1671120128.131114, "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": 1671120128.1312509, "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": 1671120128.131561, "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": 1671120128.131663, "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": 1671120128.13263, "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": 1671120128.132792, "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": 1671120128.1330292, "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": 1671120128.133186, "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": 1671120128.133353, "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": 1671120128.133505, "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": 1671120128.133667, "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": 1671120128.133843, "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": 1671120128.1340082, "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": 1671120128.1341598, "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": 1671120128.13433, "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": 1671120128.1344829, "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": 1671120128.134652, "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": 1671120128.1348119, "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": 1671120128.135197, "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": 1671120128.135336, "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": 1671120128.135651, "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": 1671120128.1357608, "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": 1671120128.13616, "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": 1671120128.136436, "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": 1671120128.136584, "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": 1671120128.137151, "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": 1671120128.137321, "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": 1671120128.137619, "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": 1671120128.1379688, "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": 1671120128.138104, "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": 1671120128.138558, "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": 1671120128.1388228, "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": 1671120128.139176, "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": 1671120128.139312, "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": 1671120128.1397572, "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": 1671120128.13994, "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": 1671120128.1401038, "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": 1671120128.140285, "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": 1671120128.140832, "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": 1671120128.140987, "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": 1671120128.141129, "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": 1671120128.141234, "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": 1671120128.1414568, "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": 1671120128.141558, "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": 1671120128.141729, "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": 1671120128.141897, "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": 1671120128.142465, "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": 1671120128.142682, "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": 1671120128.142842, "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": 1671120128.143256, "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": 1671120128.146366, "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": 1671120128.14654, "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": 1671120128.146763, "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": 1671120128.147066, "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": 1671120128.1473138, "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": 1671120128.147636, "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": 1671120128.147824, "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": 1671120128.148041, "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": 1671120128.148224, "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": 1671120128.148383, "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": 1671120128.148583, "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": 1671120128.148868, "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": 1671120128.149123, "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": 1671120128.149677, "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": 1671120128.1499798, "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": 1671120128.150125, "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": 1671120128.150323, "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": 1671120128.150837, "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": 1671120128.151277, "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": 1671120128.152979, "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": 1671120128.1531, "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": 1671120128.15327, "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": 1671120128.1533818, "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": 1671120128.153737, "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": 1671120128.153929, "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": 1671120128.1540322, "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": 1671120128.1542609, "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": 1671120128.154458, "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": 1671120128.154688, "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": 1671120128.154881, "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": 1671120128.155116, "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": 1671120128.155793, "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": 1671120128.156055, "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": 1671120128.156304, "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": 1671120128.156537, "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": 1671120128.157687, "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": 1671120128.158439, "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": 1671120128.158614, "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": 1671120128.158835, "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": 1671120128.159012, "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": 1671120128.1593878, "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": 1671120128.160053, "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": 1671120128.161654, "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": 1671120128.161929, "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": 1671120128.162126, "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": 1671120128.162287, "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": 1671120128.1624691, "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": 1671120128.162713, "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": 1671120128.1629179, "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": 1671120128.163213, "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": 1671120128.163401, "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": 1671120128.163559, "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": 1671120128.165235, "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": 1671120128.165754, "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": 1671120128.1660779, "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": 1671120128.16626, "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": 1671120128.16661, "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": 1671120128.166836, "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": 1671120128.167444, "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": 1671120128.167712, "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": 1671120128.168521, "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": 1671120128.17027, "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": 1671120128.170774, "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": 1671120128.1712692, "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": 1671120128.171728, "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": 1671120128.171814, "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": 1671120128.17252, "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": 1671120128.172766, "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": 1671120128.1730711, "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": 1671120128.1733608, "supported_languages": null}, "macro.mailchimp_source.get_automation_recipient_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_automation_recipient_columns.sql", "original_file_path": "macros/get_automation_recipient_columns.sql", "name": "get_automation_recipient_columns", "macro_sql": "{% macro get_automation_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_id\", \"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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.1741261, "supported_languages": null}, "macro.mailchimp_source.get_campaign_columns": {"unique_id": "macro.mailchimp_source.get_campaign_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_campaign_columns.sql", "original_file_path": "macros/get_campaign_columns.sql", "name": "get_campaign_columns", "macro_sql": "{% macro get_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"clicktale\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"long_archive_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"reply_to\", \"datatype\": dbt.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"test_size\", \"datatype\": dbt.type_int()},\n {\"name\": \"timewarp\", \"datatype\": \"boolean\"},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"use_conversation\", \"datatype\": \"boolean\"},\n {\"name\": \"wait_time\", \"datatype\": dbt.type_int()},\n {\"name\": \"winner_criteria\", \"datatype\": dbt.type_int()},\n {\"name\": \"winning_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"winning_combination_id\", \"datatype\": dbt.type_int()}\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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.1790102, "supported_languages": null}, "macro.mailchimp_source.get_list_columns": {"unique_id": "macro.mailchimp_source.get_list_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_list_columns.sql", "original_file_path": "macros/get_list_columns.sql", "name": "get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"beamer_address\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_address_1\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_address_2\", \"datatype\": dbt.type_int()},\n {\"name\": \"contact_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_zip\", \"datatype\": dbt.type_string()},\n {\"name\": \"date_created\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_from_email\", \"datatype\": dbt.type_string()},\n {\"name\": \"default_from_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"default_language\", \"datatype\": dbt.type_string()},\n {\"name\": \"default_subject\", \"datatype\": dbt.type_int()},\n {\"name\": \"email_type_option\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"list_rating\", \"datatype\": dbt.type_float()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"notify_on_subscribe\", \"datatype\": dbt.type_int()},\n {\"name\": \"notify_on_unsubscribe\", \"datatype\": dbt.type_int()},\n {\"name\": \"permission_reminder\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscribe_url_long\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscribe_url_short\", \"datatype\": dbt.type_string()},\n {\"name\": \"use_archive_bar\", \"datatype\": \"boolean\"},\n {\"name\": \"visibility\", \"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_int", "macro.dbt.type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.1823921, "supported_languages": null}, "macro.mailchimp_source.get_segment_columns": {"unique_id": "macro.mailchimp_source.get_segment_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_segment_columns.sql", "original_file_path": "macros/get_segment_columns.sql", "name": "get_segment_columns", "macro_sql": "{% macro get_segment_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()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.183647, "supported_languages": null}, "macro.mailchimp_source.get_automation_email_columns": {"unique_id": "macro.mailchimp_source.get_automation_email_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_automation_email_columns.sql", "original_file_path": "macros/get_automation_email_columns.sql", "name": "get_automation_email_columns", "macro_sql": "{% macro get_automation_email_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archive_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"authenticate\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_footer\", \"datatype\": \"boolean\"},\n {\"name\": \"auto_tweet\", \"datatype\": \"boolean\"},\n {\"name\": \"automation_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicktale\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"create_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"delay_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"delay_action_description\", \"datatype\": dbt.type_string()},\n {\"name\": \"delay_amount\", \"datatype\": dbt.type_int()},\n {\"name\": \"delay_direction\", \"datatype\": dbt.type_int()},\n {\"name\": \"delay_full_description\", \"datatype\": dbt.type_string()},\n {\"name\": \"delay_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"drag_and_drop\", \"datatype\": \"boolean\"},\n {\"name\": \"fb_comments\", \"datatype\": \"boolean\"},\n {\"name\": \"folder_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"from_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"google_analytics\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"inline_css\", \"datatype\": \"boolean\"},\n {\"name\": \"position\", \"datatype\": dbt.type_int()},\n {\"name\": \"reply_to\", \"datatype\": dbt.type_string()},\n {\"name\": \"send_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"start_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"subject_line\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"timewarp\", \"datatype\": dbt.type_int()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_name\", \"datatype\": dbt.type_int()},\n {\"name\": \"track_ecomm_360\", \"datatype\": \"boolean\"},\n {\"name\": \"track_goals\", \"datatype\": \"boolean\"},\n {\"name\": \"track_html_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"track_opens\", \"datatype\": \"boolean\"},\n {\"name\": \"track_text_clicks\", \"datatype\": \"boolean\"},\n {\"name\": \"use_conversation\", \"datatype\": dbt.type_int()}\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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.188135, "supported_languages": null}, "macro.mailchimp_source.get_member_columns": {"unique_id": "macro.mailchimp_source.get_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_member_columns.sql", "original_file_path": "macros/get_member_columns.sql", "name": "get_member_columns", "macro_sql": "{% macro get_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"dstoff\", \"datatype\": dbt.type_float()},\n {\"name\": \"email_address\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_client\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"gmtoff\", \"datatype\": dbt.type_float()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ip_opt\", \"datatype\": dbt.type_string()},\n {\"name\": \"ip_signup\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_changed\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"latitude\", \"datatype\": dbt.type_float()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"longitude\", \"datatype\": dbt.type_float()},\n {\"name\": \"member_rating\", \"datatype\": dbt.type_int()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"timestamp_opt\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"timestamp_signup\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()},\n {\"name\": \"unique_email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"vip\", \"datatype\": \"boolean\"}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('mailchimp__members_pass_through_columns')) }}\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_float", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.191126, "supported_languages": null}, "macro.mailchimp_source.get_automation_columns": {"unique_id": "macro.mailchimp_source.get_automation_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_automation_columns.sql", "original_file_path": "macros/get_automation_columns.sql", "name": "get_automation_columns", "macro_sql": "{% macro get_automation_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"create_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"segment_text\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"trigger_settings\", \"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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.192673, "supported_languages": null}, "macro.mailchimp_source.get_campaign_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_campaign_recipient_activity_columns.sql", "original_file_path": "macros/get_campaign_recipient_activity_columns.sql", "name": "get_campaign_recipient_activity_columns", "macro_sql": "{% macro get_campaign_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt.type_int()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"url\", \"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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.193944, "supported_languages": null}, "macro.mailchimp_source.get_campaign_recipient_columns": {"unique_id": "macro.mailchimp_source.get_campaign_recipient_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_campaign_recipient_columns.sql", "original_file_path": "macros/get_campaign_recipient_columns.sql", "name": "get_campaign_recipient_columns", "macro_sql": "{% macro get_campaign_recipient_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"combination_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_id\", \"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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.194719, "supported_languages": null}, "macro.mailchimp_source.get_unsubscribe_columns": {"unique_id": "macro.mailchimp_source.get_unsubscribe_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_unsubscribe_columns.sql", "original_file_path": "macros/get_unsubscribe_columns.sql", "name": "get_unsubscribe_columns", "macro_sql": "{% macro get_unsubscribe_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"reason\", \"datatype\": dbt.type_int()},\n {\"name\": \"timestamp\", \"datatype\": dbt.type_timestamp()}\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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.195552, "supported_languages": null}, "macro.mailchimp_source.get_segment_member_columns": {"unique_id": "macro.mailchimp_source.get_segment_member_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_segment_member_columns.sql", "original_file_path": "macros/get_segment_member_columns.sql", "name": "get_segment_member_columns", "macro_sql": "{% macro get_segment_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"segment_id\", \"datatype\": dbt.type_int()}\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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.1962738, "supported_languages": null}, "macro.mailchimp_source.get_automation_recipient_activity_columns": {"unique_id": "macro.mailchimp_source.get_automation_recipient_activity_columns", "package_name": "mailchimp_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/mailchimp/dbt_mailchimp_source/integration_tests/dbt_packages/mailchimp_source", "path": "macros/get_automation_recipient_activity_columns.sql", "original_file_path": "macros/get_automation_recipient_activity_columns.sql", "name": "get_automation_recipient_activity_columns", "macro_sql": "{% macro get_automation_recipient_activity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"action\", \"datatype\": dbt.type_string()},\n {\"name\": \"automation_email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"bounce_type\", \"datatype\": dbt.type_int()},\n {\"name\": \"ip\", \"datatype\": dbt.type_string()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"member_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"timestamp\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"url\", \"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_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671120128.197414, "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/mailchimp/dbt_mailchimp_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": 1671120128.197835, "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/mailchimp/dbt_mailchimp_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": 1671120128.198324, "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/mailchimp/dbt_mailchimp_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": 1671120128.198838, "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/mailchimp/dbt_mailchimp_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": 1671120128.199668, "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/mailchimp/dbt_mailchimp_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": 1671120128.2002702, "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/mailchimp/dbt_mailchimp_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": 1671120128.200629, "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/mailchimp/dbt_mailchimp_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": 1671120128.2017658, "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/mailchimp/dbt_mailchimp_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": 1671120128.202973, "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/mailchimp/dbt_mailchimp_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": 1671120128.203897, "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/mailchimp/dbt_mailchimp_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": 1671120128.2050061, "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/mailchimp/dbt_mailchimp_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": 1671120128.205748, "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/mailchimp/dbt_mailchimp_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": 1671120128.206099, "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/mailchimp/dbt_mailchimp_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": 1671120128.2069519, "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/mailchimp/dbt_mailchimp_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": 1671120128.207979, "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/mailchimp/dbt_mailchimp_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": 1671120128.208628, "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/mailchimp/dbt_mailchimp_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": 1671120128.209117, "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/mailchimp/dbt_mailchimp_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": 1671120128.210021, "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/mailchimp/dbt_mailchimp_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": 1671120128.210668, "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/mailchimp/dbt_mailchimp_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": 1671120128.211367, "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/mailchimp/dbt_mailchimp_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": 1671120128.2117891, "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/mailchimp/dbt_mailchimp_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": 1671120128.212333, "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/mailchimp/dbt_mailchimp_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": 1671120128.212817, "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/mailchimp/dbt_mailchimp_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": 1671120128.2134862, "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/mailchimp/dbt_mailchimp_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": 1671120128.214217, "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/mailchimp/dbt_mailchimp_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": 1671120128.214819, "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/mailchimp/dbt_mailchimp_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": 1671120128.215155, "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/mailchimp/dbt_mailchimp_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": 1671120128.215615, "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/mailchimp/dbt_mailchimp_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": 1671120128.215969, "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/mailchimp/dbt_mailchimp_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": 1671120128.2166479, "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/mailchimp/dbt_mailchimp_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": 1671120128.2174551, "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/mailchimp/dbt_mailchimp_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": 1671120128.218372, "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/mailchimp/dbt_mailchimp_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": 1671120128.219265, "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/mailchimp/dbt_mailchimp_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": 1671120128.2203379, "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/mailchimp/dbt_mailchimp_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": 1671120128.2213151, "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/mailchimp/dbt_mailchimp_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": 1671120128.222006, "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/mailchimp/dbt_mailchimp_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": 1671120128.222333, "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/mailchimp/dbt_mailchimp_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": 1671120128.225632, "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/mailchimp/dbt_mailchimp_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": 1671120128.2272818, "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/mailchimp/dbt_mailchimp_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": 1671120128.227674, "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/mailchimp/dbt_mailchimp_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": 1671120128.227851, "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/mailchimp/dbt_mailchimp_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": 1671120128.2284029, "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/mailchimp/dbt_mailchimp_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": 1671120128.228797, "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/mailchimp/dbt_mailchimp_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": 1671120128.229015, "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/mailchimp/dbt_mailchimp_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": 1671120128.2293692, "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/mailchimp/dbt_mailchimp_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": 1671120128.22972, "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/mailchimp/dbt_mailchimp_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": 1671120128.2307022, "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/mailchimp/dbt_mailchimp_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": 1671120128.231719, "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/mailchimp/dbt_mailchimp_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": 1671120128.2325451, "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/mailchimp/dbt_mailchimp_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": 1671120128.233195, "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/mailchimp/dbt_mailchimp_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": 1671120128.233449, "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/mailchimp/dbt_mailchimp_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": 1671120128.233832, "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/mailchimp/dbt_mailchimp_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": 1671120128.234338, "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/mailchimp/dbt_mailchimp_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": 1671120128.234763, "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/mailchimp/dbt_mailchimp_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": 1671120128.235591, "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/mailchimp/dbt_mailchimp_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": 1671120128.236608, "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/mailchimp/dbt_mailchimp_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": 1671120128.237565, "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/mailchimp/dbt_mailchimp_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": 1671120128.2381032, "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/mailchimp/dbt_mailchimp_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": 1671120128.238327, "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/mailchimp/dbt_mailchimp_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": 1671120128.238857, "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/mailchimp/dbt_mailchimp_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": 1671120128.239721, "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/mailchimp/dbt_mailchimp_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": 1671120128.240725, "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/mailchimp/dbt_mailchimp_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": 1671120128.241369, "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/mailchimp/dbt_mailchimp_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": 1671120128.2416892, "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/mailchimp/dbt_mailchimp_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": 1671120128.243196, "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/mailchimp/dbt_mailchimp_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": 1671120128.2447941, "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/mailchimp/dbt_mailchimp_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": 1671120128.246356, "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/mailchimp/dbt_mailchimp_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": 1671120128.248144, "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/mailchimp/dbt_mailchimp_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": 1671120128.248661, "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/mailchimp/dbt_mailchimp_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": 1671120128.2488132, "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/mailchimp/dbt_mailchimp_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": 1671120128.25205, "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/mailchimp/dbt_mailchimp_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": 1671120128.255636, "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/mailchimp/dbt_mailchimp_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": 1671120128.25614, "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/mailchimp/dbt_mailchimp_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": 1671120128.2563908, "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/mailchimp/dbt_mailchimp_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": 1671120128.25719, "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/mailchimp/dbt_mailchimp_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": 1671120128.257422, "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/mailchimp/dbt_mailchimp_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": 1671120128.2576299, "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/mailchimp/dbt_mailchimp_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": 1671120128.2578251, "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/mailchimp/dbt_mailchimp_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": 1671120128.25799, "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/mailchimp/dbt_mailchimp_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": 1671120128.2581708, "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/mailchimp/dbt_mailchimp_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": 1671120128.258632, "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/mailchimp/dbt_mailchimp_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": 1671120128.2588649, "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/mailchimp/dbt_mailchimp_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": 1671120128.2593122, "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/mailchimp/dbt_mailchimp_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": 1671120128.2598531, "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/mailchimp/dbt_mailchimp_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": 1671120128.260261, "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/mailchimp/dbt_mailchimp_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": 1671120128.260586, "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/mailchimp/dbt_mailchimp_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": 1671120128.262199, "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/mailchimp/dbt_mailchimp_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": 1671120128.2625558, "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/mailchimp/dbt_mailchimp_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": 1671120128.263514, "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/mailchimp/dbt_mailchimp_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": 1671120128.264117, "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/mailchimp/dbt_mailchimp_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": 1671120128.265464, "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/mailchimp/dbt_mailchimp_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": 1671120128.267057, "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/mailchimp/dbt_mailchimp_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": 1671120128.2682838, "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/mailchimp/dbt_mailchimp_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": 1671120128.2691462, "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/mailchimp/dbt_mailchimp_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": 1671120128.269739, "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/mailchimp/dbt_mailchimp_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": 1671120128.270517, "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/mailchimp/dbt_mailchimp_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": 1671120128.272067, "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/mailchimp/dbt_mailchimp_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": 1671120128.272556, "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/mailchimp/dbt_mailchimp_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": 1671120128.273046, "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/mailchimp/dbt_mailchimp_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": 1671120128.273252, "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/mailchimp/dbt_mailchimp_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": 1671120128.27381, "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/mailchimp/dbt_mailchimp_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": 1671120128.274438, "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/mailchimp/dbt_mailchimp_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": 1671120128.275143, "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/mailchimp/dbt_mailchimp_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": 1671120128.275828, "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/mailchimp/dbt_mailchimp_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": 1671120128.276313, "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/mailchimp/dbt_mailchimp_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": 1671120128.27646, "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/mailchimp/dbt_mailchimp_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": 1671120128.276607, "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/mailchimp/dbt_mailchimp_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": 1671120128.277183, "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/mailchimp/dbt_mailchimp_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": 1671120128.2780402, "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/mailchimp/dbt_mailchimp_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": 1671120128.27911, "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/mailchimp/dbt_mailchimp_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": 1671120128.279381, "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/mailchimp/dbt_mailchimp_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": 1671120128.279937, "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/mailchimp/dbt_mailchimp_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": 1671120128.2807198, "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/mailchimp/dbt_mailchimp_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": 1671120128.281194, "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/mailchimp/dbt_mailchimp_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": 1671120128.2821188, "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/mailchimp/dbt_mailchimp_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": 1671120128.282294, "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/mailchimp/dbt_mailchimp_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": 1671120128.282466, "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/mailchimp/dbt_mailchimp_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": 1671120128.282633, "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/mailchimp/dbt_mailchimp_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": 1671120128.282788, "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/mailchimp/dbt_mailchimp_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": 1671120128.282943, "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/mailchimp/dbt_mailchimp_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": 1671120128.283821, "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/mailchimp/dbt_mailchimp_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": 1671120128.284652, "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/mailchimp/dbt_mailchimp_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": 1671120128.28612, "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/mailchimp/dbt_mailchimp_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": 1671120128.286409, "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/mailchimp/dbt_mailchimp_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": 1671120128.28667, "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/mailchimp/dbt_mailchimp_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": 1671120128.2869272, "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/mailchimp/dbt_mailchimp_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": 1671120128.287288, "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/mailchimp/dbt_mailchimp_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": 1671120128.2876952, "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/mailchimp/dbt_mailchimp_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": 1671120128.288013, "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/mailchimp/dbt_mailchimp_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": 1671120128.2884722, "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/mailchimp/dbt_mailchimp_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": 1671120128.288585, "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/mailchimp/dbt_mailchimp_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": 1671120128.288685, "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/mailchimp/dbt_mailchimp_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": 1671120128.288786, "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/mailchimp/dbt_mailchimp_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": 1671120128.289243, "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/mailchimp/dbt_mailchimp_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": 1671120128.289899, "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/mailchimp/dbt_mailchimp_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": 1671120128.2907572, "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/mailchimp/dbt_mailchimp_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": 1671120128.291291, "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/mailchimp/dbt_mailchimp_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": 1671120128.291428, "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/mailchimp/dbt_mailchimp_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": 1671120128.291561, "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/mailchimp/dbt_mailchimp_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": 1671120128.291693, "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/mailchimp/dbt_mailchimp_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": 1671120128.291828, "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/mailchimp/dbt_mailchimp_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": 1671120128.2947881, "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/mailchimp/dbt_mailchimp_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": 1671120128.295022, "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/mailchimp/dbt_mailchimp_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": 1671120128.2951958, "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/mailchimp/dbt_mailchimp_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": 1671120128.295365, "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/mailchimp/dbt_mailchimp_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": 1671120128.297468, "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/mailchimp/dbt_mailchimp_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": 1671120128.2986271, "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/mailchimp/dbt_mailchimp_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": 1671120128.298785, "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/mailchimp/dbt_mailchimp_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": 1671120128.2990878, "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/mailchimp/dbt_mailchimp_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": 1671120128.299388, "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/mailchimp/dbt_mailchimp_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": 1671120128.29952, "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/mailchimp/dbt_mailchimp_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": 1671120128.29965, "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/mailchimp/dbt_mailchimp_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": 1671120128.299774, "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/mailchimp/dbt_mailchimp_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": 1671120128.300406, "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/mailchimp/dbt_mailchimp_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": 1671120128.301067, "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/mailchimp/dbt_mailchimp_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": 1671120128.301655, "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/mailchimp/dbt_mailchimp_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": 1671120128.3018591, "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/mailchimp/dbt_mailchimp_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": 1671120128.302082, "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/mailchimp/dbt_mailchimp_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": 1671120128.30242, "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/mailchimp/dbt_mailchimp_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": 1671120128.303584, "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/mailchimp/dbt_mailchimp_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": 1671120128.307604, "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/mailchimp/dbt_mailchimp_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": 1671120128.3080041, "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/mailchimp/dbt_mailchimp_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": 1671120128.308506, "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/mailchimp/dbt_mailchimp_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": 1671120128.310088, "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/mailchimp/dbt_mailchimp_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": 1671120128.310635, "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/mailchimp/dbt_mailchimp_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": 1671120128.311251, "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/mailchimp/dbt_mailchimp_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": 1671120128.311411, "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/mailchimp/dbt_mailchimp_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": 1671120128.31157, "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/mailchimp/dbt_mailchimp_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": 1671120128.311737, "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/mailchimp/dbt_mailchimp_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": 1671120128.31189, "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/mailchimp/dbt_mailchimp_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": 1671120128.312039, "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/mailchimp/dbt_mailchimp_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": 1671120128.312775, "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/mailchimp/dbt_mailchimp_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": 1671120128.313766, "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/mailchimp/dbt_mailchimp_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": 1671120128.314503, "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/mailchimp/dbt_mailchimp_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": 1671120128.3146749, "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/mailchimp/dbt_mailchimp_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": 1671120128.314841, "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/mailchimp/dbt_mailchimp_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": 1671120128.315003, "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/mailchimp/dbt_mailchimp_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": 1671120128.315157, "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/mailchimp/dbt_mailchimp_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": 1671120128.3153338, "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/mailchimp/dbt_mailchimp_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": 1671120128.315655, "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/mailchimp/dbt_mailchimp_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": 1671120128.3157592, "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/mailchimp/dbt_mailchimp_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": 1671120128.315934, "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/mailchimp/dbt_mailchimp_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": 1671120128.316653, "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/mailchimp/dbt_mailchimp_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": 1671120128.318126, "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/mailchimp/dbt_mailchimp_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": 1671120128.320637, "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/mailchimp/dbt_mailchimp_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": 1671120128.3222332, "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/mailchimp/dbt_mailchimp_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": 1671120128.322604, "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/mailchimp/dbt_mailchimp_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": 1671120128.3227122, "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/mailchimp/dbt_mailchimp_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": 1671120128.322813, "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/mailchimp/dbt_mailchimp_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": 1671120128.323287, "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/mailchimp/dbt_mailchimp_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": 1671120128.3237581, "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"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.mailchimp_source_integration_tests.campaign_recipient": [], "seed.mailchimp_source_integration_tests.unsubscribe": [], "seed.mailchimp_source_integration_tests.automation": [], "seed.mailchimp_source_integration_tests.segment_member": [], "seed.mailchimp_source_integration_tests.automation_email": [], "seed.mailchimp_source_integration_tests.automation_recipient": [], "seed.mailchimp_source_integration_tests.campaign_recipient_activity": [], "seed.mailchimp_source_integration_tests.list": [], "seed.mailchimp_source_integration_tests.member": [], "seed.mailchimp_source_integration_tests.segment": [], "seed.mailchimp_source_integration_tests.automation_recipient_activity": [], "seed.mailchimp_source_integration_tests.campaign": [], "model.mailchimp_source.stg_mailchimp__segments": ["model.mailchimp_source.stg_mailchimp__segments_tmp", "model.mailchimp_source.stg_mailchimp__segments_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp", "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__lists": ["model.mailchimp_source.stg_mailchimp__lists_tmp", "model.mailchimp_source.stg_mailchimp__lists_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp", "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp", "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"], "model.mailchimp_source.stg_mailchimp__campaigns": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp", "model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "model.mailchimp_source.stg_mailchimp__automations": ["model.mailchimp_source.stg_mailchimp__automations_tmp", "model.mailchimp_source.stg_mailchimp__automations_tmp"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp", "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp", "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "model.mailchimp_source.stg_mailchimp__members": ["model.mailchimp_source.stg_mailchimp__members_tmp", "model.mailchimp_source.stg_mailchimp__members_tmp"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp", "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "model.mailchimp_source.stg_mailchimp__segment_members": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp", "model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["source.mailchimp_source.mailchimp.automation_recipient_activity"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["source.mailchimp_source.mailchimp.unsubscribe"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["source.mailchimp_source.mailchimp.list"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["source.mailchimp_source.mailchimp.segment"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["source.mailchimp_source.mailchimp.campaign"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["source.mailchimp_source.mailchimp.segment_member"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["source.mailchimp_source.mailchimp.member"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["source.mailchimp_source.mailchimp.automation"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["source.mailchimp_source.mailchimp.automation_email"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["source.mailchimp_source.mailchimp.automation_recipient"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["source.mailchimp_source.mailchimp.campaign_recipient_activity"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d": ["model.mailchimp_source.stg_mailchimp__automation_activities"], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594": ["model.mailchimp_source.stg_mailchimp__automation_emails"], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272": ["model.mailchimp_source.stg_mailchimp__automation_recipients"], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a": ["model.mailchimp_source.stg_mailchimp__automations"], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199": ["model.mailchimp_source.stg_mailchimp__campaign_recipients"], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da": ["model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd": ["model.mailchimp_source.stg_mailchimp__campaigns"], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121": ["model.mailchimp_source.stg_mailchimp__lists"], "test.mailchimp_source.unique_stg_mailchimp__members_member_id.cb23726c11": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.70b6c824fb": ["model.mailchimp_source.stg_mailchimp__members"], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744": ["model.mailchimp_source.stg_mailchimp__segments"], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746": ["model.mailchimp_source.stg_mailchimp__unsubscribes"], "source.mailchimp_source.mailchimp.automation": [], "source.mailchimp_source.mailchimp.automation_email": [], "source.mailchimp_source.mailchimp.automation_recipient": [], "source.mailchimp_source.mailchimp.automation_recipient_activity": [], "source.mailchimp_source.mailchimp.campaign": [], "source.mailchimp_source.mailchimp.campaign_recipient": [], "source.mailchimp_source.mailchimp.campaign_recipient_activity": [], "source.mailchimp_source.mailchimp.segment": [], "source.mailchimp_source.mailchimp.segment_member": [], "source.mailchimp_source.mailchimp.list": [], "source.mailchimp_source.mailchimp.member": [], "source.mailchimp_source.mailchimp.unsubscribe": []}, "child_map": {"seed.mailchimp_source_integration_tests.campaign_recipient": [], "seed.mailchimp_source_integration_tests.unsubscribe": [], "seed.mailchimp_source_integration_tests.automation": [], "seed.mailchimp_source_integration_tests.segment_member": [], "seed.mailchimp_source_integration_tests.automation_email": [], "seed.mailchimp_source_integration_tests.automation_recipient": [], "seed.mailchimp_source_integration_tests.campaign_recipient_activity": [], "seed.mailchimp_source_integration_tests.list": [], "seed.mailchimp_source_integration_tests.member": [], "seed.mailchimp_source_integration_tests.segment": [], "seed.mailchimp_source_integration_tests.automation_recipient_activity": [], "seed.mailchimp_source_integration_tests.campaign": [], "model.mailchimp_source.stg_mailchimp__segments": ["test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744", "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5"], "model.mailchimp_source.stg_mailchimp__campaign_recipients": ["test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199", "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d"], "model.mailchimp_source.stg_mailchimp__lists": ["test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121", "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92"], "model.mailchimp_source.stg_mailchimp__automation_activities": ["test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475", "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d"], "model.mailchimp_source.stg_mailchimp__unsubscribes": ["test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab", "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746"], "model.mailchimp_source.stg_mailchimp__campaigns": ["test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd", "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0"], "model.mailchimp_source.stg_mailchimp__automations": ["test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a", "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b"], "model.mailchimp_source.stg_mailchimp__automation_emails": ["test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594", "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7"], "model.mailchimp_source.stg_mailchimp__automation_recipients": ["test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912", "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272"], "model.mailchimp_source.stg_mailchimp__members": ["test.mailchimp_source.not_null_stg_mailchimp__members_member_id.70b6c824fb", "test.mailchimp_source.unique_stg_mailchimp__members_member_id.cb23726c11"], "model.mailchimp_source.stg_mailchimp__campaign_activities": ["test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da", "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe"], "model.mailchimp_source.stg_mailchimp__segment_members": [], "model.mailchimp_source.stg_mailchimp__automation_activities_tmp": ["model.mailchimp_source.stg_mailchimp__automation_activities", "model.mailchimp_source.stg_mailchimp__automation_activities"], "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp": ["model.mailchimp_source.stg_mailchimp__unsubscribes", "model.mailchimp_source.stg_mailchimp__unsubscribes"], "model.mailchimp_source.stg_mailchimp__lists_tmp": ["model.mailchimp_source.stg_mailchimp__lists", "model.mailchimp_source.stg_mailchimp__lists"], "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_recipients", "model.mailchimp_source.stg_mailchimp__campaign_recipients"], "model.mailchimp_source.stg_mailchimp__segments_tmp": ["model.mailchimp_source.stg_mailchimp__segments", "model.mailchimp_source.stg_mailchimp__segments"], "model.mailchimp_source.stg_mailchimp__campaigns_tmp": ["model.mailchimp_source.stg_mailchimp__campaigns", "model.mailchimp_source.stg_mailchimp__campaigns"], "model.mailchimp_source.stg_mailchimp__segment_members_tmp": ["model.mailchimp_source.stg_mailchimp__segment_members", "model.mailchimp_source.stg_mailchimp__segment_members"], "model.mailchimp_source.stg_mailchimp__members_tmp": ["model.mailchimp_source.stg_mailchimp__members", "model.mailchimp_source.stg_mailchimp__members"], "model.mailchimp_source.stg_mailchimp__automations_tmp": ["model.mailchimp_source.stg_mailchimp__automations", "model.mailchimp_source.stg_mailchimp__automations"], "model.mailchimp_source.stg_mailchimp__automation_emails_tmp": ["model.mailchimp_source.stg_mailchimp__automation_emails", "model.mailchimp_source.stg_mailchimp__automation_emails"], "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp": ["model.mailchimp_source.stg_mailchimp__automation_recipients", "model.mailchimp_source.stg_mailchimp__automation_recipients"], "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp": ["model.mailchimp_source.stg_mailchimp__campaign_activities", "model.mailchimp_source.stg_mailchimp__campaign_activities"], "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475": [], "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d": [], "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594": [], "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912": [], "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272": [], "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b": [], "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199": [], "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe": [], "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da": [], "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0": [], "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd": [], "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92": [], "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121": [], "test.mailchimp_source.unique_stg_mailchimp__members_member_id.cb23726c11": [], "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.70b6c824fb": [], "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5": [], "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744": [], "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab": [], "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746": [], "source.mailchimp_source.mailchimp.automation": ["model.mailchimp_source.stg_mailchimp__automations_tmp"], "source.mailchimp_source.mailchimp.automation_email": ["model.mailchimp_source.stg_mailchimp__automation_emails_tmp"], "source.mailchimp_source.mailchimp.automation_recipient": ["model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"], "source.mailchimp_source.mailchimp.automation_recipient_activity": ["model.mailchimp_source.stg_mailchimp__automation_activities_tmp"], "source.mailchimp_source.mailchimp.campaign": ["model.mailchimp_source.stg_mailchimp__campaigns_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient": ["model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"], "source.mailchimp_source.mailchimp.campaign_recipient_activity": ["model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"], "source.mailchimp_source.mailchimp.segment": ["model.mailchimp_source.stg_mailchimp__segments_tmp"], "source.mailchimp_source.mailchimp.segment_member": ["model.mailchimp_source.stg_mailchimp__segment_members_tmp"], "source.mailchimp_source.mailchimp.list": ["model.mailchimp_source.stg_mailchimp__lists_tmp"], "source.mailchimp_source.mailchimp.member": ["model.mailchimp_source.stg_mailchimp__members_tmp"], "source.mailchimp_source.mailchimp.unsubscribe": ["model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 2979507..cf2cdd8 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-10-22T16:06:56.214250Z", "invocation_id": "93fff409-e037-41f9-8d04-fe719ae3d15b", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.179790Z", "completed_at": "2021-10-22T16:06:54.207266Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.207993Z", "completed_at": "2021-10-22T16:06:54.208041Z"}], "thread_id": "Thread-1", "execution_time": 0.031182050704956055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.180176Z", "completed_at": "2021-10-22T16:06:54.207454Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.208251Z", "completed_at": "2021-10-22T16:06:54.208262Z"}], "thread_id": "Thread-3", "execution_time": 0.03052687644958496, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.180329Z", "completed_at": "2021-10-22T16:06:54.207730Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.208600Z", "completed_at": "2021-10-22T16:06:54.208612Z"}], "thread_id": "Thread-4", "execution_time": 0.030730247497558594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.179992Z", "completed_at": "2021-10-22T16:06:54.208397Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.209757Z", "completed_at": "2021-10-22T16:06:54.209767Z"}], "thread_id": "Thread-2", "execution_time": 0.033010244369506836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.213274Z", "completed_at": "2021-10-22T16:06:54.235061Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.235831Z", "completed_at": "2021-10-22T16:06:54.235851Z"}], "thread_id": "Thread-1", "execution_time": 0.0245969295501709, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.213425Z", "completed_at": "2021-10-22T16:06:54.235557Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.236068Z", "completed_at": "2021-10-22T16:06:54.236078Z"}], "thread_id": "Thread-3", "execution_time": 0.0249330997467041, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.213884Z", "completed_at": "2021-10-22T16:06:54.236711Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.237863Z", "completed_at": "2021-10-22T16:06:54.237873Z"}], "thread_id": "Thread-4", "execution_time": 0.026211261749267578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.224346Z", "completed_at": "2021-10-22T16:06:54.236852Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.238047Z", "completed_at": "2021-10-22T16:06:54.238056Z"}], "thread_id": "Thread-2", "execution_time": 0.025859832763671875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.239925Z", "completed_at": "2021-10-22T16:06:54.254287Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.266820Z", "completed_at": "2021-10-22T16:06:54.266836Z"}], "thread_id": "Thread-1", "execution_time": 0.029250144958496094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.240801Z", "completed_at": "2021-10-22T16:06:54.266993Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.268185Z", "completed_at": "2021-10-22T16:06:54.268201Z"}], "thread_id": "Thread-3", "execution_time": 0.030413150787353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.253818Z", "completed_at": "2021-10-22T16:06:54.269128Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.270674Z", "completed_at": "2021-10-22T16:06:54.270688Z"}], "thread_id": "Thread-4", "execution_time": 0.02660083770751953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.254048Z", "completed_at": "2021-10-22T16:06:54.269532Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.270879Z", "completed_at": "2021-10-22T16:06:54.270890Z"}], "thread_id": "Thread-2", "execution_time": 0.026642799377441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.290965Z", "completed_at": "2021-10-22T16:06:54.869153Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.869339Z", "completed_at": "2021-10-22T16:06:54.869357Z"}], "thread_id": "Thread-2", "execution_time": 0.5883009433746338, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.280482Z", "completed_at": "2021-10-22T16:06:54.904103Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.904611Z", "completed_at": "2021-10-22T16:06:54.904631Z"}], "thread_id": "Thread-3", "execution_time": 0.6328861713409424, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.290743Z", "completed_at": "2021-10-22T16:06:54.905529Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.906428Z", "completed_at": "2021-10-22T16:06:54.906448Z"}], "thread_id": "Thread-4", "execution_time": 0.629136323928833, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.271477Z", "completed_at": "2021-10-22T16:06:54.936131Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:54.936343Z", "completed_at": "2021-10-22T16:06:54.936356Z"}], "thread_id": "Thread-1", "execution_time": 0.6667032241821289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.870702Z", "completed_at": "2021-10-22T16:06:55.447440Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:55.447606Z", "completed_at": "2021-10-22T16:06:55.447620Z"}], "thread_id": "Thread-2", "execution_time": 0.577711820602417, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.919630Z", "completed_at": "2021-10-22T16:06:55.486653Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:55.486802Z", "completed_at": "2021-10-22T16:06:55.486813Z"}], "thread_id": "Thread-4", "execution_time": 0.5686521530151367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.911278Z", "completed_at": "2021-10-22T16:06:55.499221Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:55.499376Z", "completed_at": "2021-10-22T16:06:55.499387Z"}], "thread_id": "Thread-3", "execution_time": 0.5921781063079834, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:54.937943Z", "completed_at": "2021-10-22T16:06:55.542486Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:55.542629Z", "completed_at": "2021-10-22T16:06:55.542640Z"}], "thread_id": "Thread-1", "execution_time": 0.605440616607666, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:55.448687Z", "completed_at": "2021-10-22T16:06:56.051686Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.051834Z", "completed_at": "2021-10-22T16:06:56.051845Z"}], "thread_id": "Thread-2", "execution_time": 0.6036999225616455, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.052970Z", "completed_at": "2021-10-22T16:06:56.062333Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.062505Z", "completed_at": "2021-10-22T16:06:56.062519Z"}], "thread_id": "Thread-2", "execution_time": 0.010151386260986328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.490a0f9e84"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.063408Z", "completed_at": "2021-10-22T16:06:56.071853Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.072007Z", "completed_at": "2021-10-22T16:06:56.072018Z"}], "thread_id": "Thread-2", "execution_time": 0.009111881256103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.e61cacda17"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.072797Z", "completed_at": "2021-10-22T16:06:56.078959Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.079100Z", "completed_at": "2021-10-22T16:06:56.079109Z"}], "thread_id": "Thread-2", "execution_time": 0.006785154342651367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.0040d8fb48"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.079944Z", "completed_at": "2021-10-22T16:06:56.085058Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.085196Z", "completed_at": "2021-10-22T16:06:56.085206Z"}], "thread_id": "Thread-2", "execution_time": 0.005754232406616211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.f2984415c9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.086027Z", "completed_at": "2021-10-22T16:06:56.091009Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.091145Z", "completed_at": "2021-10-22T16:06:56.091154Z"}], "thread_id": "Thread-2", "execution_time": 0.005596160888671875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.a3b2b327a1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.091993Z", "completed_at": "2021-10-22T16:06:56.097073Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.097218Z", "completed_at": "2021-10-22T16:06:56.097228Z"}], "thread_id": "Thread-2", "execution_time": 0.00574493408203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.3c05fa2096"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.098079Z", "completed_at": "2021-10-22T16:06:56.107451Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.109513Z", "completed_at": "2021-10-22T16:06:56.109525Z"}], "thread_id": "Thread-2", "execution_time": 0.012366771697998047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.af9eb9ae67"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.112281Z", "completed_at": "2021-10-22T16:06:56.119424Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.120014Z", "completed_at": "2021-10-22T16:06:56.120025Z"}], "thread_id": "Thread-2", "execution_time": 0.009328842163085938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.3f7efb016d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:55.487863Z", "completed_at": "2021-10-22T16:06:56.120551Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.121523Z", "completed_at": "2021-10-22T16:06:56.121531Z"}], "thread_id": "Thread-4", "execution_time": 0.6360149383544922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:55.543647Z", "completed_at": "2021-10-22T16:06:56.124962Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.130414Z", "completed_at": "2021-10-22T16:06:56.130424Z"}], "thread_id": "Thread-1", "execution_time": 0.587939977645874, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.124611Z", "completed_at": "2021-10-22T16:06:56.136972Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.137870Z", "completed_at": "2021-10-22T16:06:56.137881Z"}], "thread_id": "Thread-2", "execution_time": 0.015280961990356445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.b978f29aed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.130567Z", "completed_at": "2021-10-22T16:06:56.138760Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.139647Z", "completed_at": "2021-10-22T16:06:56.139654Z"}], "thread_id": "Thread-4", "execution_time": 0.019967079162597656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.0535a630ee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:55.500414Z", "completed_at": "2021-10-22T16:06:56.145474Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.146268Z", "completed_at": "2021-10-22T16:06:56.146280Z"}], "thread_id": "Thread-3", "execution_time": 0.6518919467926025, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.139526Z", "completed_at": "2021-10-22T16:06:56.146376Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.152206Z", "completed_at": "2021-10-22T16:06:56.152214Z"}], "thread_id": "Thread-1", "execution_time": 0.01461029052734375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.8bcf47ead4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.146089Z", "completed_at": "2021-10-22T16:06:56.157885Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.158543Z", "completed_at": "2021-10-22T16:06:56.158551Z"}], "thread_id": "Thread-2", "execution_time": 0.018511056900024414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.84e705d346"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.152351Z", "completed_at": "2021-10-22T16:06:56.158913Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.164035Z", "completed_at": "2021-10-22T16:06:56.164042Z"}], "thread_id": "Thread-4", "execution_time": 0.022387027740478516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.a025f8e1a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.158367Z", "completed_at": "2021-10-22T16:06:56.169036Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.169819Z", "completed_at": "2021-10-22T16:06:56.169828Z"}], "thread_id": "Thread-3", "execution_time": 0.013116121292114258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.edc62267fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.163910Z", "completed_at": "2021-10-22T16:06:56.169962Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.170936Z", "completed_at": "2021-10-22T16:06:56.170943Z"}], "thread_id": "Thread-1", "execution_time": 0.017395973205566406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.f76b69b83d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.170122Z", "completed_at": "2021-10-22T16:06:56.182996Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.183722Z", "completed_at": "2021-10-22T16:06:56.183733Z"}], "thread_id": "Thread-2", "execution_time": 0.019815921783447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.708f68f0eb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.175529Z", "completed_at": "2021-10-22T16:06:56.183858Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.189168Z", "completed_at": "2021-10-22T16:06:56.189179Z"}], "thread_id": "Thread-4", "execution_time": 0.02435898780822754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.7c6fd8168c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.183286Z", "completed_at": "2021-10-22T16:06:56.194799Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.195642Z", "completed_at": "2021-10-22T16:06:56.195651Z"}], "thread_id": "Thread-3", "execution_time": 0.013870716094970703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_member_id.93c6cde1f9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.188668Z", "completed_at": "2021-10-22T16:06:56.195523Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.196146Z", "completed_at": "2021-10-22T16:06:56.196154Z"}], "thread_id": "Thread-1", "execution_time": 0.017800092697143555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.f63844341e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.195776Z", "completed_at": "2021-10-22T16:06:56.206592Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.206891Z", "completed_at": "2021-10-22T16:06:56.206901Z"}], "thread_id": "Thread-2", "execution_time": 0.01671600341796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.14dc0a3816"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.200989Z", "completed_at": "2021-10-22T16:06:56.211447Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.211954Z", "completed_at": "2021-10-22T16:06:56.211961Z"}], "thread_id": "Thread-4", "execution_time": 0.016468048095703125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.ef3e03eb00"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-22T16:06:56.206758Z", "completed_at": "2021-10-22T16:06:56.212475Z"}, {"name": "execute", "started_at": "2021-10-22T16:06:56.212709Z", "completed_at": "2021-10-22T16:06:56.212716Z"}], "thread_id": "Thread-3", "execution_time": 0.006700038909912109, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.82152d7b83"}], "elapsed_time": 3.2746989727020264, "args": {"log_format": "default", "write_json": true, "use_experimental_parser": false, "profiles_dir": "/Users/renee.li/.dbt", "use_cache": true, "compile": true, "version_check": true, "which": "generate", "rpc_method": "docs.generate"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-12-15T16:02:21.231696Z", "invocation_id": "ca9318cc-9843-47a5-8982-a6c7f5766aaf", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.117606Z", "completed_at": "2022-12-15T16:02:20.127142Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.127338Z", "completed_at": "2022-12-15T16:02:20.127346Z"}], "thread_id": "Thread-1", "execution_time": 0.011410951614379883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.117686Z", "completed_at": "2022-12-15T16:02:20.127420Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.128419Z", "completed_at": "2022-12-15T16:02:20.128422Z"}], "thread_id": "Thread-2", "execution_time": 0.012491703033447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.118019Z", "completed_at": "2022-12-15T16:02:20.127817Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.128747Z", "completed_at": "2022-12-15T16:02:20.128750Z"}], "thread_id": "Thread-3", "execution_time": 0.012622833251953125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.118098Z", "completed_at": "2022-12-15T16:02:20.127935Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.128842Z", "completed_at": "2022-12-15T16:02:20.128845Z"}], "thread_id": "Thread-4", "execution_time": 0.012653112411499023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.129975Z", "completed_at": "2022-12-15T16:02:20.133334Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.139577Z", "completed_at": "2022-12-15T16:02:20.139582Z"}], "thread_id": "Thread-1", "execution_time": 0.011512994766235352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.133268Z", "completed_at": "2022-12-15T16:02:20.139762Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.140539Z", "completed_at": "2022-12-15T16:02:20.140543Z"}], "thread_id": "Thread-2", "execution_time": 0.01082301139831543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.133458Z", "completed_at": "2022-12-15T16:02:20.140251Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.141241Z", "completed_at": "2022-12-15T16:02:20.141244Z"}], "thread_id": "Thread-4", "execution_time": 0.008964776992797852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.133392Z", "completed_at": "2022-12-15T16:02:20.140300Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.141309Z", "completed_at": "2022-12-15T16:02:20.141311Z"}], "thread_id": "Thread-3", "execution_time": 0.009435892105102539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.142094Z", "completed_at": "2022-12-15T16:02:20.145292Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.151484Z", "completed_at": "2022-12-15T16:02:20.151491Z"}], "thread_id": "Thread-1", "execution_time": 0.011182069778442383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.145064Z", "completed_at": "2022-12-15T16:02:20.151559Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.152531Z", "completed_at": "2022-12-15T16:02:20.152535Z"}], "thread_id": "Thread-2", "execution_time": 0.010993242263793945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.147485Z", "completed_at": "2022-12-15T16:02:20.152194Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.153279Z", "completed_at": "2022-12-15T16:02:20.153282Z"}], "thread_id": "Thread-3", "execution_time": 0.009010076522827148, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.147413Z", "completed_at": "2022-12-15T16:02:20.152259Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.153372Z", "completed_at": "2022-12-15T16:02:20.153376Z"}], "thread_id": "Thread-4", "execution_time": 0.009498119354248047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.154225Z", "completed_at": "2022-12-15T16:02:20.157109Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.158604Z", "completed_at": "2022-12-15T16:02:20.158609Z"}], "thread_id": "Thread-1", "execution_time": 0.008006095886230469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.automation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.157184Z", "completed_at": "2022-12-15T16:02:20.158694Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.161253Z", "completed_at": "2022-12-15T16:02:20.161257Z"}], "thread_id": "Thread-2", "execution_time": 0.007550954818725586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.automation_email"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.158447Z", "completed_at": "2022-12-15T16:02:20.160982Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.161970Z", "completed_at": "2022-12-15T16:02:20.161973Z"}], "thread_id": "Thread-3", "execution_time": 0.005808115005493164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.automation_recipient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.158523Z", "completed_at": "2022-12-15T16:02:20.161061Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.162055Z", "completed_at": "2022-12-15T16:02:20.162058Z"}], "thread_id": "Thread-4", "execution_time": 0.005834102630615234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.automation_recipient_activity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.162856Z", "completed_at": "2022-12-15T16:02:20.164878Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.166297Z", "completed_at": "2022-12-15T16:02:20.166302Z"}], "thread_id": "Thread-1", "execution_time": 0.0075910091400146484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.campaign"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.164948Z", "completed_at": "2022-12-15T16:02:20.166370Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.169482Z", "completed_at": "2022-12-15T16:02:20.169485Z"}], "thread_id": "Thread-2", "execution_time": 0.007118940353393555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.campaign_recipient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.166159Z", "completed_at": "2022-12-15T16:02:20.169268Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.170156Z", "completed_at": "2022-12-15T16:02:20.170159Z"}], "thread_id": "Thread-3", "execution_time": 0.00622105598449707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.campaign_recipient_activity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.166230Z", "completed_at": "2022-12-15T16:02:20.169335Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.170224Z", "completed_at": "2022-12-15T16:02:20.170227Z"}], "thread_id": "Thread-4", "execution_time": 0.006245851516723633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.list"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.171045Z", "completed_at": "2022-12-15T16:02:20.173124Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.174505Z", "completed_at": "2022-12-15T16:02:20.174509Z"}], "thread_id": "Thread-1", "execution_time": 0.006943941116333008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.member"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.173189Z", "completed_at": "2022-12-15T16:02:20.174576Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.177062Z", "completed_at": "2022-12-15T16:02:20.177066Z"}], "thread_id": "Thread-2", "execution_time": 0.006493806838989258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.segment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.174368Z", "completed_at": "2022-12-15T16:02:20.176850Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.177730Z", "completed_at": "2022-12-15T16:02:20.177733Z"}], "thread_id": "Thread-3", "execution_time": 0.0055179595947265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.segment_member"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.174441Z", "completed_at": "2022-12-15T16:02:20.176916Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.177798Z", "completed_at": "2022-12-15T16:02:20.177800Z"}], "thread_id": "Thread-4", "execution_time": 0.005528926849365234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.mailchimp_source_integration_tests.unsubscribe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.178499Z", "completed_at": "2022-12-15T16:02:20.450274Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.450454Z", "completed_at": "2022-12-15T16:02:20.450459Z"}], "thread_id": "Thread-1", "execution_time": 0.3041832447052002, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.189673Z", "completed_at": "2022-12-15T16:02:20.480982Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.481777Z", "completed_at": "2022-12-15T16:02:20.481781Z"}], "thread_id": "Thread-4", "execution_time": 0.32219982147216797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.185245Z", "completed_at": "2022-12-15T16:02:20.481098Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.482121Z", "completed_at": "2022-12-15T16:02:20.482124Z"}], "thread_id": "Thread-2", "execution_time": 0.3333570957183838, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_emails"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.189601Z", "completed_at": "2022-12-15T16:02:20.481633Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.482503Z", "completed_at": "2022-12-15T16:02:20.482507Z"}], "thread_id": "Thread-3", "execution_time": 0.32752275466918945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__automation_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.507761Z", "completed_at": "2022-12-15T16:02:20.765797Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.766046Z", "completed_at": "2022-12-15T16:02:20.766052Z"}], "thread_id": "Thread-4", "execution_time": 0.2881028652191162, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_recipients"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.482885Z", "completed_at": "2022-12-15T16:02:20.768634Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.768790Z", "completed_at": "2022-12-15T16:02:20.768794Z"}], "thread_id": "Thread-1", "execution_time": 0.3249540328979492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaign_activities"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.513413Z", "completed_at": "2022-12-15T16:02:20.807780Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.812585Z", "completed_at": "2022-12-15T16:02:20.812592Z"}], "thread_id": "Thread-3", "execution_time": 0.33039307594299316, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__campaigns"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.513350Z", "completed_at": "2022-12-15T16:02:20.861609Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:20.861790Z", "completed_at": "2022-12-15T16:02:20.861795Z"}], "thread_id": "Thread-2", "execution_time": 0.37471699714660645, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__lists"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.812767Z", "completed_at": "2022-12-15T16:02:21.079962Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.080132Z", "completed_at": "2022-12-15T16:02:21.080138Z"}], "thread_id": "Thread-1", "execution_time": 0.2965068817138672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segment_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.108947Z", "completed_at": "2022-12-15T16:02:21.115891Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.116052Z", "completed_at": "2022-12-15T16:02:21.116060Z"}], "thread_id": "Thread-1", "execution_time": 0.007680177688598633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_activities_activity_id.0ae0f21475"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.116870Z", "completed_at": "2022-12-15T16:02:21.120771Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.121108Z", "completed_at": "2022-12-15T16:02:21.121112Z"}], "thread_id": "Thread-1", "execution_time": 0.004804849624633789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_activities_activity_id.1737f52a7d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.121883Z", "completed_at": "2022-12-15T16:02:21.125014Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.125183Z", "completed_at": "2022-12-15T16:02:21.125187Z"}], "thread_id": "Thread-1", "execution_time": 0.0038111209869384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automations_automation_id.cf748ea94a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.125937Z", "completed_at": "2022-12-15T16:02:21.128462Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.128616Z", "completed_at": "2022-12-15T16:02:21.128620Z"}], "thread_id": "Thread-1", "execution_time": 0.0031690597534179688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automations_automation_id.455bcbd36b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.844141Z", "completed_at": "2022-12-15T16:02:21.105055Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.105358Z", "completed_at": "2022-12-15T16:02:21.105361Z"}], "thread_id": "Thread-3", "execution_time": 0.28815793991088867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__unsubscribes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.129440Z", "completed_at": "2022-12-15T16:02:21.132688Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.135521Z", "completed_at": "2022-12-15T16:02:21.135526Z"}], "thread_id": "Thread-1", "execution_time": 0.0067729949951171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_emails_automation_email_id.019e811594"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.807396Z", "completed_at": "2022-12-15T16:02:21.104967Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.105289Z", "completed_at": "2022-12-15T16:02:21.105295Z"}], "thread_id": "Thread-4", "execution_time": 0.3338010311126709, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.132780Z", "completed_at": "2022-12-15T16:02:21.136383Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.137170Z", "completed_at": "2022-12-15T16:02:21.137174Z"}], "thread_id": "Thread-3", "execution_time": 0.005120992660522461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__automation_recipients_automation_recipient_id.f0b2e24912"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.137304Z", "completed_at": "2022-12-15T16:02:21.142982Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.146304Z", "completed_at": "2022-12-15T16:02:21.146309Z"}], "thread_id": "Thread-1", "execution_time": 0.010064840316772461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_emails_automation_email_id.a61e4c82c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.137609Z", "completed_at": "2022-12-15T16:02:21.143198Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.146804Z", "completed_at": "2022-12-15T16:02:21.146807Z"}], "thread_id": "Thread-4", "execution_time": 0.010291337966918945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__automation_recipients_automation_recipient_id.9c2cfa6272"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.143072Z", "completed_at": "2022-12-15T16:02:21.146983Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.147743Z", "completed_at": "2022-12-15T16:02:21.147747Z"}], "thread_id": "Thread-3", "execution_time": 0.005578279495239258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_recipients_email_id.e7aace8199"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.148004Z", "completed_at": "2022-12-15T16:02:21.153477Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.155972Z", "completed_at": "2022-12-15T16:02:21.155978Z"}], "thread_id": "Thread-1", "execution_time": 0.00905299186706543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_recipients_email_id.1e1843671d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.150779Z", "completed_at": "2022-12-15T16:02:21.155886Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.156487Z", "completed_at": "2022-12-15T16:02:21.156491Z"}], "thread_id": "Thread-4", "execution_time": 0.009078741073608398, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaign_activities_activity_id.7c968c29da"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.153589Z", "completed_at": "2022-12-15T16:02:21.156549Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.157379Z", "completed_at": "2022-12-15T16:02:21.157383Z"}], "thread_id": "Thread-3", "execution_time": 0.007080078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaign_activities_activity_id.1ed119dcbe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.158088Z", "completed_at": "2022-12-15T16:02:21.163314Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.166584Z", "completed_at": "2022-12-15T16:02:21.166590Z"}], "thread_id": "Thread-1", "execution_time": 0.009877920150756836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__campaigns_campaign_id.b6967f01dd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.160604Z", "completed_at": "2022-12-15T16:02:21.166302Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.166710Z", "completed_at": "2022-12-15T16:02:21.166713Z"}], "thread_id": "Thread-4", "execution_time": 0.009769916534423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__campaigns_campaign_id.534c6a58a0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.163263Z", "completed_at": "2022-12-15T16:02:21.166644Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.167508Z", "completed_at": "2022-12-15T16:02:21.167512Z"}], "thread_id": "Thread-3", "execution_time": 0.00733637809753418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__lists_list_id.c08bbf9121"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.168639Z", "completed_at": "2022-12-15T16:02:21.176188Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.176479Z", "completed_at": "2022-12-15T16:02:21.176484Z"}], "thread_id": "Thread-1", "execution_time": 0.009166955947875977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__lists_list_id.2d7d469b92"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.168920Z", "completed_at": "2022-12-15T16:02:21.176401Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.176969Z", "completed_at": "2022-12-15T16:02:21.176972Z"}], "thread_id": "Thread-4", "execution_time": 0.00923609733581543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__unsubscribes_unsubscribe_id.77bd90d9ab"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.173860Z", "completed_at": "2022-12-15T16:02:21.176608Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.177481Z", "completed_at": "2022-12-15T16:02:21.177484Z"}], "thread_id": "Thread-3", "execution_time": 0.009341955184936523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__unsubscribes_unsubscribe_id.c34aefd746"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.178494Z", "completed_at": "2022-12-15T16:02:21.183396Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.183611Z", "completed_at": "2022-12-15T16:02:21.183616Z"}], "thread_id": "Thread-1", "execution_time": 0.006355762481689453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__members_member_id.70b6c824fb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.181022Z", "completed_at": "2022-12-15T16:02:21.183540Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.184028Z", "completed_at": "2022-12-15T16:02:21.184031Z"}], "thread_id": "Thread-4", "execution_time": 0.0060520172119140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__members_member_id.cb23726c11"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:20.888209Z", "completed_at": "2022-12-15T16:02:21.196167Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.196316Z", "completed_at": "2022-12-15T16:02:21.196321Z"}], "thread_id": "Thread-2", "execution_time": 0.33524107933044434, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.mailchimp_source.stg_mailchimp__segments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.223707Z", "completed_at": "2022-12-15T16:02:21.229997Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.230148Z", "completed_at": "2022-12-15T16:02:21.230153Z"}], "thread_id": "Thread-3", "execution_time": 0.006947994232177734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.not_null_stg_mailchimp__segments_segment_id.310ec9f744"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-15T16:02:21.227623Z", "completed_at": "2022-12-15T16:02:21.230548Z"}, {"name": "execute", "started_at": "2022-12-15T16:02:21.230699Z", "completed_at": "2022-12-15T16:02:21.230703Z"}], "thread_id": "Thread-1", "execution_time": 0.003579854965209961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.mailchimp_source.unique_stg_mailchimp__segments_segment_id.48f28610b5"}], "elapsed_time": 1.9510142803192139, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/joseph.markiewicz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "target": "postgres", "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index ba3fbfd..877ec89 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -1,4 +1,5 @@ -# HEY! This file is used in the dbt package integrations tests with CircleCI. + +# HEY! This file is used in the dbt package integrations tests with Buildkite. # You should __NEVER__ check credentials into version control. Thanks for reading :) config: @@ -6,7 +7,7 @@ config: use_colors: True integration_tests: - target: snowflake + target: redshift outputs: redshift: type: redshift @@ -19,11 +20,11 @@ integration_tests: threads: 8 bigquery: type: bigquery - method: service-account - keyfile: "{{ env_var('GCLOUD_SERVICE_KEY_PATH') }}" + method: service-account-json project: 'dbt-package-testing' schema: mailchimp_source_integration_tests threads: 8 + keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: type: snowflake account: "{{ env_var('CI_SNOWFLAKE_DBT_ACCOUNT') }}" @@ -43,15 +44,11 @@ integration_tests: port: 5432 schema: mailchimp_source_integration_tests threads: 8 - spark: - type: spark - method: http + databricks: + catalog: null + host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" + http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" schema: mailchimp_source_integration_tests - host: "{{ env_var('CI_SPARK_DBT_HOST') }}" - organization: "{{ env_var('CI_SPARK_DBT_ORGANIZATION') }}" - token: "{{ env_var('CI_SPARK_DBT_TOKEN') }}" - cluster: "{{ env_var('CI_SPARK_DBT_CLUSTER') }}" - port: 443 - connect_timeout: 60 - connect_retries: 5 - threads: 8 \ No newline at end of file + threads: 2 + token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" + type: databricks \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index be7bbd8..e07d684 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,27 +1,24 @@ name: 'mailchimp_source_integration_tests' -version: '0.2.0' - +version: '0.4.0' config-version: 2 - profile: 'integration_tests' - vars: mailchimp_source: - automation: "{{ ref('automation') }}" - automation_email: "{{ ref('automation_email') }}" - automation_recipient: "{{ ref('automation_recipient') }}" - automation_recipient_activity: "{{ ref('automation_recipient_activity') }}" - campaign: "{{ ref('campaign') }}" - campaign_recipient: "{{ ref('campaign_recipient') }}" - campaign_recipient_activity: "{{ ref('campaign_recipient_activity') }}" - mailchimp_segment: "{{ ref('segment') }}" - segment_member: "{{ ref('segment_member') }}" - list: "{{ ref('list') }}" - member: "{{ ref('member') }}" - unsubscribe: "{{ ref('unsubscribe') }}" - using_automations: True - using_segments: True - + mailchimp_schema: mailchimp_source_integration_tests + mailchimp_automation_identifier: "automation" + mailchimp_automation_email_identifier: "automation_email" + mailchimp_automation_recipient_identifier: "automation_recipient" + mailchimp_automation_recipient_activity_identifier: "automation_recipient_activity" + mailchimp_campaign_identifier: "campaign" + mailchimp_campaign_recipient_identifier: "campaign_recipient" + mailchimp_campaign_recipient_activity_identifier: "campaign_recipient_activity" + mailchimp_mailchimp_segment_identifier: "segment" + mailchimp_segment_member_identifier: "segment_member" + mailchimp_list_identifier: "list" + mailchimp_member_identifier: "member" + mailchimp_unsubscribe_identifier: "unsubscribe" + using_automations: true + using_segments: true seeds: mailchimp_source_integration_tests: +quote_columns: "{{ true if target.type == 'redshift' else false }}" @@ -57,11 +54,10 @@ seeds: last_changed: timestamp timestamp_opt: timestamp timestamp_signup: timestamp - mailchimp_segment: - +column_types: + segment: + +column_types: created_at: timestamp updated_at: timestamp unsubscribe: +column_types: timestamp: timestamp - diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt index 89c6ccb..87ae0f9 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements.txt @@ -1,6 +1,7 @@ -dbt-snowflake~=1.0.0 -dbt-bigquery~=1.0.0 -dbt-redshift~=1.0.0 -dbt-postgres~=1.0.0 -dbt-spark~=1.0.0 -dbt-spark[PyHive]~=1.0.0 +dbt-snowflake>=1.3.0,<2.0.0 +dbt-bigquery>=1.3.0,<2.0.0 +dbt-redshift>=1.3.0,<2.0.0 +dbt-postgres>=1.3.0,<2.0.0 +dbt-spark>=1.3.0,<2.0.0 +dbt-spark[PyHive]>=1.3.0,<2.0.0 +dbt-databricks>=1.3.0,<2.0.0 \ No newline at end of file diff --git a/macros/get_automation_columns.sql b/macros/get_automation_columns.sql index de97b90..0e2a60e 100644 --- a/macros/get_automation_columns.sql +++ b/macros/get_automation_columns.sql @@ -2,16 +2,16 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "create_time", "datatype": dbt_utils.type_timestamp()}, - {"name": "id", "datatype": dbt_utils.type_string()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "segment_id", "datatype": dbt_utils.type_int()}, - {"name": "segment_text", "datatype": dbt_utils.type_int()}, - {"name": "start_time", "datatype": dbt_utils.type_timestamp()}, - {"name": "status", "datatype": dbt_utils.type_string()}, - {"name": "title", "datatype": dbt_utils.type_string()}, - {"name": "trigger_settings", "datatype": dbt_utils.type_string()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "create_time", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "segment_id", "datatype": dbt.type_int()}, + {"name": "segment_text", "datatype": dbt.type_int()}, + {"name": "start_time", "datatype": dbt.type_timestamp()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "trigger_settings", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/macros/get_automation_email_columns.sql b/macros/get_automation_email_columns.sql index 3b75db3..152db9d 100644 --- a/macros/get_automation_email_columns.sql +++ b/macros/get_automation_email_columns.sql @@ -2,44 +2,44 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "archive_url", "datatype": dbt_utils.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "archive_url", "datatype": dbt.type_string()}, {"name": "authenticate", "datatype": "boolean"}, {"name": "auto_footer", "datatype": "boolean"}, {"name": "auto_tweet", "datatype": "boolean"}, - {"name": "automation_id", "datatype": dbt_utils.type_string()}, - {"name": "clicktale", "datatype": dbt_utils.type_int()}, - {"name": "content_type", "datatype": dbt_utils.type_string()}, - {"name": "create_time", "datatype": dbt_utils.type_timestamp()}, - {"name": "delay_action", "datatype": dbt_utils.type_string()}, - {"name": "delay_action_description", "datatype": dbt_utils.type_string()}, - {"name": "delay_amount", "datatype": dbt_utils.type_int()}, - {"name": "delay_direction", "datatype": dbt_utils.type_int()}, - {"name": "delay_full_description", "datatype": dbt_utils.type_string()}, - {"name": "delay_type", "datatype": dbt_utils.type_string()}, + {"name": "automation_id", "datatype": dbt.type_string()}, + {"name": "clicktale", "datatype": dbt.type_int()}, + {"name": "content_type", "datatype": dbt.type_string()}, + {"name": "create_time", "datatype": dbt.type_timestamp()}, + {"name": "delay_action", "datatype": dbt.type_string()}, + {"name": "delay_action_description", "datatype": dbt.type_string()}, + {"name": "delay_amount", "datatype": dbt.type_int()}, + {"name": "delay_direction", "datatype": dbt.type_int()}, + {"name": "delay_full_description", "datatype": dbt.type_string()}, + {"name": "delay_type", "datatype": dbt.type_string()}, {"name": "drag_and_drop", "datatype": "boolean"}, {"name": "fb_comments", "datatype": "boolean"}, - {"name": "folder_id", "datatype": dbt_utils.type_int()}, - {"name": "from_name", "datatype": dbt_utils.type_string()}, - {"name": "google_analytics", "datatype": dbt_utils.type_string()}, - {"name": "id", "datatype": dbt_utils.type_string()}, + {"name": "folder_id", "datatype": dbt.type_int()}, + {"name": "from_name", "datatype": dbt.type_string()}, + {"name": "google_analytics", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_string()}, {"name": "inline_css", "datatype": "boolean"}, - {"name": "position", "datatype": dbt_utils.type_int()}, - {"name": "reply_to", "datatype": dbt_utils.type_string()}, - {"name": "send_time", "datatype": dbt_utils.type_timestamp()}, - {"name": "start_time", "datatype": dbt_utils.type_timestamp()}, - {"name": "status", "datatype": dbt_utils.type_string()}, - {"name": "subject_line", "datatype": dbt_utils.type_string()}, - {"name": "template_id", "datatype": dbt_utils.type_int()}, - {"name": "timewarp", "datatype": dbt_utils.type_int()}, - {"name": "title", "datatype": dbt_utils.type_string()}, - {"name": "to_name", "datatype": dbt_utils.type_int()}, + {"name": "position", "datatype": dbt.type_int()}, + {"name": "reply_to", "datatype": dbt.type_string()}, + {"name": "send_time", "datatype": dbt.type_timestamp()}, + {"name": "start_time", "datatype": dbt.type_timestamp()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "subject_line", "datatype": dbt.type_string()}, + {"name": "template_id", "datatype": dbt.type_int()}, + {"name": "timewarp", "datatype": dbt.type_int()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "to_name", "datatype": dbt.type_int()}, {"name": "track_ecomm_360", "datatype": "boolean"}, {"name": "track_goals", "datatype": "boolean"}, {"name": "track_html_clicks", "datatype": "boolean"}, {"name": "track_opens", "datatype": "boolean"}, {"name": "track_text_clicks", "datatype": "boolean"}, - {"name": "use_conversation", "datatype": dbt_utils.type_int()} + {"name": "use_conversation", "datatype": dbt.type_int()} ] %} {{ return(columns) }} diff --git a/macros/get_automation_recipient_activity_columns.sql b/macros/get_automation_recipient_activity_columns.sql index 855296a..c77e3c9 100644 --- a/macros/get_automation_recipient_activity_columns.sql +++ b/macros/get_automation_recipient_activity_columns.sql @@ -1,15 +1,15 @@ {% macro get_automation_recipient_activity_columns() %} {% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "action", "datatype": dbt_utils.type_string()}, - {"name": "automation_email_id", "datatype": dbt_utils.type_string()}, - {"name": "bounce_type", "datatype": dbt_utils.type_int()}, - {"name": "ip", "datatype": dbt_utils.type_string()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_id", "datatype": dbt_utils.type_string()}, - {"name": "timestamp", "datatype": dbt_utils.type_timestamp()}, - {"name": "url", "datatype": dbt_utils.type_string()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "action", "datatype": dbt.type_string()}, + {"name": "automation_email_id", "datatype": dbt.type_string()}, + {"name": "bounce_type", "datatype": dbt.type_int()}, + {"name": "ip", "datatype": dbt.type_string()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_id", "datatype": dbt.type_string()}, + {"name": "timestamp", "datatype": dbt.type_timestamp()}, + {"name": "url", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/macros/get_automation_recipient_columns.sql b/macros/get_automation_recipient_columns.sql index 10cbbea..0b66fb6 100644 --- a/macros/get_automation_recipient_columns.sql +++ b/macros/get_automation_recipient_columns.sql @@ -1,10 +1,10 @@ {% macro get_automation_recipient_columns() %} {% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "automation_email_id", "datatype": dbt_utils.type_string()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_id", "datatype": dbt_utils.type_string()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "automation_email_id", "datatype": dbt.type_string()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_id", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/macros/get_campaign_columns.sql b/macros/get_campaign_columns.sql index 4bb7f07..06233f0 100644 --- a/macros/get_campaign_columns.sql +++ b/macros/get_campaign_columns.sql @@ -2,45 +2,45 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "archive_url", "datatype": dbt_utils.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "archive_url", "datatype": dbt.type_string()}, {"name": "authenticate", "datatype": "boolean"}, {"name": "auto_footer", "datatype": "boolean"}, {"name": "auto_tweet", "datatype": "boolean"}, - {"name": "clicktale", "datatype": dbt_utils.type_string()}, - {"name": "content_type", "datatype": dbt_utils.type_string()}, - {"name": "create_time", "datatype": dbt_utils.type_timestamp()}, + {"name": "clicktale", "datatype": dbt.type_string()}, + {"name": "content_type", "datatype": dbt.type_string()}, + {"name": "create_time", "datatype": dbt.type_timestamp()}, {"name": "drag_and_drop", "datatype": "boolean"}, {"name": "fb_comments", "datatype": "boolean"}, - {"name": "folder_id", "datatype": dbt_utils.type_int()}, - {"name": "from_name", "datatype": dbt_utils.type_string()}, - {"name": "google_analytics", "datatype": dbt_utils.type_string()}, - {"name": "id", "datatype": dbt_utils.type_string()}, + {"name": "folder_id", "datatype": dbt.type_int()}, + {"name": "from_name", "datatype": dbt.type_string()}, + {"name": "google_analytics", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_string()}, {"name": "inline_css", "datatype": "boolean"}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "long_archive_url", "datatype": dbt_utils.type_string()}, - {"name": "reply_to", "datatype": dbt_utils.type_string()}, - {"name": "segment_id", "datatype": dbt_utils.type_int()}, - {"name": "segment_text", "datatype": dbt_utils.type_int()}, - {"name": "send_time", "datatype": dbt_utils.type_timestamp()}, - {"name": "status", "datatype": dbt_utils.type_string()}, - {"name": "subject_line", "datatype": dbt_utils.type_string()}, - {"name": "template_id", "datatype": dbt_utils.type_int()}, - {"name": "test_size", "datatype": dbt_utils.type_int()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "long_archive_url", "datatype": dbt.type_string()}, + {"name": "reply_to", "datatype": dbt.type_string()}, + {"name": "segment_id", "datatype": dbt.type_int()}, + {"name": "segment_text", "datatype": dbt.type_int()}, + {"name": "send_time", "datatype": dbt.type_timestamp()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "subject_line", "datatype": dbt.type_string()}, + {"name": "template_id", "datatype": dbt.type_int()}, + {"name": "test_size", "datatype": dbt.type_int()}, {"name": "timewarp", "datatype": "boolean"}, - {"name": "title", "datatype": dbt_utils.type_string()}, - {"name": "to_name", "datatype": dbt_utils.type_string()}, + {"name": "title", "datatype": dbt.type_string()}, + {"name": "to_name", "datatype": dbt.type_string()}, {"name": "track_ecomm_360", "datatype": "boolean"}, {"name": "track_goals", "datatype": "boolean"}, {"name": "track_html_clicks", "datatype": "boolean"}, {"name": "track_opens", "datatype": "boolean"}, {"name": "track_text_clicks", "datatype": "boolean"}, - {"name": "type", "datatype": dbt_utils.type_string()}, + {"name": "type", "datatype": dbt.type_string()}, {"name": "use_conversation", "datatype": "boolean"}, - {"name": "wait_time", "datatype": dbt_utils.type_int()}, - {"name": "winner_criteria", "datatype": dbt_utils.type_int()}, - {"name": "winning_campaign_id", "datatype": dbt_utils.type_int()}, - {"name": "winning_combination_id", "datatype": dbt_utils.type_int()} + {"name": "wait_time", "datatype": dbt.type_int()}, + {"name": "winner_criteria", "datatype": dbt.type_int()}, + {"name": "winning_campaign_id", "datatype": dbt.type_int()}, + {"name": "winning_combination_id", "datatype": dbt.type_int()} ] %} {{ return(columns) }} diff --git a/macros/get_campaign_recipient_activity_columns.sql b/macros/get_campaign_recipient_activity_columns.sql index 72458f6..db86366 100644 --- a/macros/get_campaign_recipient_activity_columns.sql +++ b/macros/get_campaign_recipient_activity_columns.sql @@ -1,16 +1,16 @@ {% macro get_campaign_recipient_activity_columns() %} {% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "action", "datatype": dbt_utils.type_string()}, - {"name": "bounce_type", "datatype": dbt_utils.type_int()}, - {"name": "campaign_id", "datatype": dbt_utils.type_string()}, - {"name": "combination_id", "datatype": dbt_utils.type_int()}, - {"name": "ip", "datatype": dbt_utils.type_string()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_id", "datatype": dbt_utils.type_string()}, - {"name": "timestamp", "datatype": dbt_utils.type_timestamp()}, - {"name": "url", "datatype": dbt_utils.type_string()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "action", "datatype": dbt.type_string()}, + {"name": "bounce_type", "datatype": dbt.type_int()}, + {"name": "campaign_id", "datatype": dbt.type_string()}, + {"name": "combination_id", "datatype": dbt.type_int()}, + {"name": "ip", "datatype": dbt.type_string()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_id", "datatype": dbt.type_string()}, + {"name": "timestamp", "datatype": dbt.type_timestamp()}, + {"name": "url", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/macros/get_campaign_recipient_columns.sql b/macros/get_campaign_recipient_columns.sql index 0b8a221..43c16db 100644 --- a/macros/get_campaign_recipient_columns.sql +++ b/macros/get_campaign_recipient_columns.sql @@ -1,11 +1,11 @@ {% macro get_campaign_recipient_columns() %} {% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "campaign_id", "datatype": dbt_utils.type_string()}, - {"name": "combination_id", "datatype": dbt_utils.type_int()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_id", "datatype": dbt_utils.type_string()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "campaign_id", "datatype": dbt.type_string()}, + {"name": "combination_id", "datatype": dbt.type_int()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_id", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/macros/get_list_columns.sql b/macros/get_list_columns.sql index 2d31825..d789571 100644 --- a/macros/get_list_columns.sql +++ b/macros/get_list_columns.sql @@ -2,31 +2,31 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "beamer_address", "datatype": dbt_utils.type_string()}, - {"name": "contact_address_1", "datatype": dbt_utils.type_string()}, - {"name": "contact_address_2", "datatype": dbt_utils.type_int()}, - {"name": "contact_city", "datatype": dbt_utils.type_string()}, - {"name": "contact_company", "datatype": dbt_utils.type_string()}, - {"name": "contact_country", "datatype": dbt_utils.type_string()}, - {"name": "contact_state", "datatype": dbt_utils.type_string()}, - {"name": "contact_zip", "datatype": dbt_utils.type_string()}, - {"name": "date_created", "datatype": dbt_utils.type_timestamp()}, - {"name": "default_from_email", "datatype": dbt_utils.type_string()}, - {"name": "default_from_name", "datatype": dbt_utils.type_string()}, - {"name": "default_language", "datatype": dbt_utils.type_string()}, - {"name": "default_subject", "datatype": dbt_utils.type_int()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "beamer_address", "datatype": dbt.type_string()}, + {"name": "contact_address_1", "datatype": dbt.type_string()}, + {"name": "contact_address_2", "datatype": dbt.type_int()}, + {"name": "contact_city", "datatype": dbt.type_string()}, + {"name": "contact_company", "datatype": dbt.type_string()}, + {"name": "contact_country", "datatype": dbt.type_string()}, + {"name": "contact_state", "datatype": dbt.type_string()}, + {"name": "contact_zip", "datatype": dbt.type_string()}, + {"name": "date_created", "datatype": dbt.type_timestamp()}, + {"name": "default_from_email", "datatype": dbt.type_string()}, + {"name": "default_from_name", "datatype": dbt.type_string()}, + {"name": "default_language", "datatype": dbt.type_string()}, + {"name": "default_subject", "datatype": dbt.type_int()}, {"name": "email_type_option", "datatype": "boolean"}, - {"name": "id", "datatype": dbt_utils.type_string()}, - {"name": "list_rating", "datatype": dbt_utils.type_float()}, - {"name": "name", "datatype": dbt_utils.type_string()}, - {"name": "notify_on_subscribe", "datatype": dbt_utils.type_int()}, - {"name": "notify_on_unsubscribe", "datatype": dbt_utils.type_int()}, - {"name": "permission_reminder", "datatype": dbt_utils.type_string()}, - {"name": "subscribe_url_long", "datatype": dbt_utils.type_string()}, - {"name": "subscribe_url_short", "datatype": dbt_utils.type_string()}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "list_rating", "datatype": dbt.type_float()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "notify_on_subscribe", "datatype": dbt.type_int()}, + {"name": "notify_on_unsubscribe", "datatype": dbt.type_int()}, + {"name": "permission_reminder", "datatype": dbt.type_string()}, + {"name": "subscribe_url_long", "datatype": dbt.type_string()}, + {"name": "subscribe_url_short", "datatype": dbt.type_string()}, {"name": "use_archive_bar", "datatype": "boolean"}, - {"name": "visibility", "datatype": dbt_utils.type_string()} + {"name": "visibility", "datatype": dbt.type_string()} ] %} {{ return(columns) }} diff --git a/macros/get_member_columns.sql b/macros/get_member_columns.sql index c9a05c3..9d4898b 100644 --- a/macros/get_member_columns.sql +++ b/macros/get_member_columns.sql @@ -1,27 +1,27 @@ {% macro get_member_columns() %} {% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "country_code", "datatype": dbt_utils.type_string()}, - {"name": "dstoff", "datatype": dbt_utils.type_float()}, - {"name": "email_address", "datatype": dbt_utils.type_string()}, - {"name": "email_client", "datatype": dbt_utils.type_string()}, - {"name": "email_type", "datatype": dbt_utils.type_string()}, - {"name": "gmtoff", "datatype": dbt_utils.type_float()}, - {"name": "id", "datatype": dbt_utils.type_string()}, - {"name": "ip_opt", "datatype": dbt_utils.type_string()}, - {"name": "ip_signup", "datatype": dbt_utils.type_string()}, - {"name": "language", "datatype": dbt_utils.type_string()}, - {"name": "last_changed", "datatype": dbt_utils.type_timestamp()}, - {"name": "latitude", "datatype": dbt_utils.type_float()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "longitude", "datatype": dbt_utils.type_float()}, - {"name": "member_rating", "datatype": dbt_utils.type_int()}, - {"name": "status", "datatype": dbt_utils.type_string()}, - {"name": "timestamp_opt", "datatype": dbt_utils.type_timestamp()}, - {"name": "timestamp_signup", "datatype": dbt_utils.type_timestamp()}, - {"name": "timezone", "datatype": dbt_utils.type_string()}, - {"name": "unique_email_id", "datatype": dbt_utils.type_string()}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "country_code", "datatype": dbt.type_string()}, + {"name": "dstoff", "datatype": dbt.type_float()}, + {"name": "email_address", "datatype": dbt.type_string()}, + {"name": "email_client", "datatype": dbt.type_string()}, + {"name": "email_type", "datatype": dbt.type_string()}, + {"name": "gmtoff", "datatype": dbt.type_float()}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "ip_opt", "datatype": dbt.type_string()}, + {"name": "ip_signup", "datatype": dbt.type_string()}, + {"name": "language", "datatype": dbt.type_string()}, + {"name": "last_changed", "datatype": dbt.type_timestamp()}, + {"name": "latitude", "datatype": dbt.type_float()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "longitude", "datatype": dbt.type_float()}, + {"name": "member_rating", "datatype": dbt.type_int()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "timestamp_opt", "datatype": dbt.type_timestamp()}, + {"name": "timestamp_signup", "datatype": dbt.type_timestamp()}, + {"name": "timezone", "datatype": dbt.type_string()}, + {"name": "unique_email_id", "datatype": dbt.type_string()}, {"name": "vip", "datatype": "boolean"} ] %} diff --git a/macros/get_segment_columns.sql b/macros/get_segment_columns.sql index 27ca782..6ede6ba 100644 --- a/macros/get_segment_columns.sql +++ b/macros/get_segment_columns.sql @@ -2,14 +2,14 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "created_at", "datatype": dbt_utils.type_timestamp()}, - {"name": "id", "datatype": dbt_utils.type_int()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_count", "datatype": dbt_utils.type_int()}, - {"name": "name", "datatype": dbt_utils.type_string()}, - {"name": "type", "datatype": dbt_utils.type_string()}, - {"name": "updated_at", "datatype": dbt_utils.type_timestamp()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_count", "datatype": dbt.type_int()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "type", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} ] %} {{ return(columns) }} diff --git a/macros/get_segment_member_columns.sql b/macros/get_segment_member_columns.sql index 3458534..92b2f75 100644 --- a/macros/get_segment_member_columns.sql +++ b/macros/get_segment_member_columns.sql @@ -2,10 +2,10 @@ {% set columns = [ {"name": "_fivetran_deleted", "datatype": "boolean"}, - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_id", "datatype": dbt_utils.type_string()}, - {"name": "segment_id", "datatype": dbt_utils.type_int()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_id", "datatype": dbt.type_string()}, + {"name": "segment_id", "datatype": dbt.type_int()} ] %} {{ return(columns) }} diff --git a/macros/get_unsubscribe_columns.sql b/macros/get_unsubscribe_columns.sql index d806151..545a00e 100644 --- a/macros/get_unsubscribe_columns.sql +++ b/macros/get_unsubscribe_columns.sql @@ -1,12 +1,12 @@ {% macro get_unsubscribe_columns() %} {% set columns = [ - {"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, - {"name": "campaign_id", "datatype": dbt_utils.type_string()}, - {"name": "list_id", "datatype": dbt_utils.type_string()}, - {"name": "member_id", "datatype": dbt_utils.type_string()}, - {"name": "reason", "datatype": dbt_utils.type_int()}, - {"name": "timestamp", "datatype": dbt_utils.type_timestamp()} + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "campaign_id", "datatype": dbt.type_string()}, + {"name": "list_id", "datatype": dbt.type_string()}, + {"name": "member_id", "datatype": dbt.type_string()}, + {"name": "reason", "datatype": dbt.type_int()}, + {"name": "timestamp", "datatype": dbt.type_timestamp()} ] %} {{ return(columns) }} diff --git a/models/src_mailchimp.yml b/models/src_mailchimp.yml index c44fcc5..4b262cc 100644 --- a/models/src_mailchimp.yml +++ b/models/src_mailchimp.yml @@ -1,200 +1,148 @@ version: 2 - sources: - name: mailchimp schema: "{{ var('mailchimp_schema', 'mailchimp') }}" database: "{{ var('mailchimp_database', target.database) }}" - loader: fivetran loaded_at_field: _fivetran_synced - freshness: warn_after: {count: 72, period: hour} error_after: {count: 168, period: hour} - tables: - - name: automation + identifier: "{{ var('mailchimp_automation_identifier', 'automation')}}" description: Each record represents an automation in Mailchimp. meta: is_enabled: "{{ var('using_automations', true) }}" columns: - name: id description: The ID of the automation in Mailchimp. - - name: list_id description: The ID of the List an automation was sent to. - - name: segment_id description: The ID of the Segment an automation was sent to. - - name: segment_text description: The field describing the Segment an automation was sent to. - - name: start_time description: The date and time the Automation was started. - - name: create_time description: The date and time the Automation was created. - - name: status description: > The current status of the Automation. Possible Values: save, paused, sending - - name: title description: The title of the Automation. - - name: trigger_settings description: Available triggers for Automation workflows. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: _fivetran_deleted description: Boolean that is true if the row has been soft-deleted from the source. - name: automation_email + identifier: "{{ var('mailchimp_automation_email_identifier', 'automation_email')}}" description: Each record represents an automation email (that make up automations). meta: is_enabled: "{{ var('using_automations', true) }}" columns: - name: id description: The ID of the email. - - name: automation_id description: The ID of the automation an email relates to. - - name: create_time description: The date and time the automation email was created. - - name: start_time description: The date and time the automation email was started. - - name: send_time description: The date and time the automation email was sent. - - name: from_name description: The 'from' name on the automation email (not an email address). - - name: reply_to description: The reply-to email address for the automation. - - name: status description: The current status of the automation email. - - name: subject_line description: The subject line for the automation email. - - name: title description: The title for the automation email. - - name: to_name description: The automation email's custom 'To' name. Typically the first name merge field. - - name: archive_url description: The link to the automation email's archive version in ISO 8601 format. - - name: authenticate description: Whether Mailchimp authenticated the automation email. Defaults to true. - - name: auto_footer description: Automatically append Mailchimp's default footer to the automation email. - - name: auto_tweet description: Automatically tweet a link to the automation email archive page when the automation email is sent. - - name: clicktale description: The custom slug for ClickTale tracking (max of 50 bytes). - - name: content_type description: How the automation email's content is put together ('template', 'drag_and_drop', 'html', 'url'). - - name: delay_action description: The action that triggers the delay of an Automation email. - - name: delay_action_description description: The user-friendly description of the action that triggers an Automation email. - - name: delay_amount description: The delay amount for an Automation email. - - name: delay_direction description: Whether the delay settings describe before or after the delay action of an Automation email. - - name: delay_full_description description: The user-friendly description of the delay and trigger action settings for an Automation email. - - name: delay_type description: The type of delay for an Automation email. - - name: drag_and_drop description: Whether the automation email uses the drag-and-drop editor. - - name: fb_comments description: Allows Facebook comments on the automation email (also force-enables the Campaign Archive toolbar). Defaults to true. - - name: folder_id description: If the automation email is listed in a folder, the ID for that folder. - - name: google_analytics description: The custom slug for Google Analytics tracking (max of 50 bytes). - - name: inline_css description: Automatically inline the CSS included with the automation email content. - - name: position description: The position of an Automation email in a workflow. - - name: template_id description: The ID for the template used in this automation email. - - name: timewarp description: Send this automation email using Timewarpe_this - - name: track_ecomm_360 description: Whether to enable eCommerce360 tracking. - - name: track_goals description: Whether to enable Goal tracking. - - name: track_html_clicks description: Whether to track clicks in the HTML version of the automation email. Defaults to true. Cannot be set to false for variate campaigns. - - name: track_opens description: Whether to track opens. Defaults to true. Cannot be set to false for variate automation emails. - - name: track_text_clicks description: Whether to track clicks in the plain-text version of the automation email. Defaults to true. Cannot be set to false for variate campaigns. - - name: use_conversation description: Use Mailchimp Conversation feature to manage out-of-office replies. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: _fivetran_deleted description: Boolean that is true if the row has been soft-deleted from the source. - name: automation_recipient + identifier: "{{ var('mailchimp_automation_recipient_identifier', 'automation_recipient')}}" description: Each record represents info about the recipient of each automation. meta: is_enabled: "{{ var('using_automations', true) }}" columns: - name: member_id description: The ID of the member the automation was sent to. - - name: automation_email_id description: The ID for the automation email. - - name: list_id description: The ID of the List an automation was sent to. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - name: automation_recipient_activity + identifier: "{{ var('mailchimp_automation_recipient_activity_identifier', 'automation_recipient_activity')}}" description: Each record represents an activity taken in relation to a automation email. meta: is_enabled: "{{ var('using_automations', true) }}" @@ -202,33 +150,26 @@ sources: - name: action description: > One of the following actions: 'open', 'click', or 'bounce' - - name: automation_email_id description: The ID for the automation email that relates to the activity. - - name: member_id description: The ID of the member the activity relates to. - - name: list_id description: The ID of the list the email was sent to. - - name: timestamp description: The timestamp when the activity occurred. - - name: ip description: The IP address recorded for the action. - - name: url description: If the action is a 'click', the URL on which the member clicked. - - name: bounce_type description: > If the action is a 'bounce', the type of bounce received: 'hard', 'soft'. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - name: campaign + identifier: "{{ var('mailchimp_campaign_identifier', 'campaign')}}" description: Each record represents a campaign in Mailchimp. columns: - name: id @@ -236,105 +177,72 @@ sources: - name: segment_id description: The ID of the Segment a campaign was sent to. - - name: create_time description: The date and time the campaign was created. - - name: send_time description: The date and time a campaign was sent. - - name: list_id description: The ID of the List a campaign was sent to. - - name: reply_to description: The reply-to email address for the campaign. - - name: type description: > The type of campaign sent. Possible values: regular, plaintext, absplit, variate, rss. - - name: title description: The title of the campaign. - - name: archive_url description: The link to the campaign's archive version in ISO 8601 format. - - name: authenticate description: Whether Mailchimp authenticated the campaign. Defaults to true. - - name: auto_footer description: Automatically append Mailchimp's default footer to the campaign. - - name: auto_tweet description: Automatically tweet a link to the campaign archive page when the campaign is sent. - - name: clicktale description: The custom slug for ClickTale tracking (max of 50 bytes). - - name: content_type description: How the campaign's content is put together ('template', 'drag_and_drop', 'html', 'url'). - - name: drag_and_drop description: Whether the campaign uses the drag-and-drop editor. - - name: fb_comments description: Allows Facebook comments on the campaign (also force-enables the Campaign Archive toolbar). Defaults to true. - - name: folder_id description: If the campaign is listed in a folder, the ID for that folder. - - name: from_name description: The 'from' name on the campaign (not an email address). - - name: google_analytics description: The custom slug for Google Analytics tracking (max of 50 bytes). - - name: inline_css description: Automatically inline the CSS included with the campaign content. - - name: long_archive_url description: The original link to the campaign's archive version. - - name: status description: The current status of the campaign. - - name: subject_line description: The subject line for the campaign. - - name: template_id description: The ID for the template used in this campaign. - - name: test_size description: The percentage of recipients to send the test combinations to, must be a value between 10 and 100. - - name: timewarp description: Send this campaign using Timewarpe_this - - name: to_name description: The campaign's custom 'To' name. Typically the first name merge field. - - name: track_ecomm_360 description: Whether to enable eCommerce360 tracking. - - name: track_goals description: Whether to enable Goal tracking. - - name: track_html_clicks description: Whether to track clicks in the HTML version of the campaign. Defaults to true. Cannot be set to false for variate campaigns. - - name: track_opens description: Whether to track opens. Defaults to true. Cannot be set to false for variate campaigns. - - name: track_text_clicks description: Whether to track clicks in the plain-text version of the campaign. Defaults to true. Cannot be set to false for variate campaigns. - - name: use_conversation description: Use Mailchimp Conversation feature to manage out-of-office replies. - - name: wait_time description: The number of minutes to wait before choosing the winning campaign. The value of wait_time must be greater than 0 and in whole hours, specified in minutes. - - name: winner_criteria description: > The combination that performs the best. @@ -342,296 +250,221 @@ sources: you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application. - - name: winning_campaign_id description: ID of the campaign that was sent to the remaining recipients based on the winning combination. - - name: winning_combination_id description: ID for the winning combination. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: _fivetran_deleted description: Boolean that is true if the row has been soft-deleted from the source. - - name: campaign_recipient + identifier: "{{ var('mailchimp_campaign_recipient_identifier', 'campaign_recipient')}}" description: Each record represents the send of a campaign email. columns: - name: campaign_id description: The ID of the campaign a sent email is from. - - name: member_id description: The ID of the member an email was sent to. - - name: combination_id description: The ID of the combination the member was part of for a campaign. - - name: list_id description: The ID of the list the campaign was sent to. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: campaign_recipient_activity + identifier: "{{ var('mailchimp_campaign_recipient_activity_identifier', 'campaign_recipient_activity')}}" description: Each record represents an activity taken in relation to a campaign email. columns: - name: action description: > One of the following actions: 'open', 'click', or 'bounce' - - name: campaign_id description: The unique ID for the sent campaign. - - name: member_id description: The ID of the member the activity relates to. - - name: list_id description: The ID of the list the email was sent to. - - name: timestamp description: The timestamp when the activity occurred. - - name: ip description: The IP address recorded for the action. - - name: url description: If the action is a 'click', the URL on which the member clicked. - - name: bounce_type description: > If the action is a 'bounce', the type of bounce received: 'hard', 'soft'. - - name: combination_id description: The ID of the combination the member was part of for a campaign. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - name: segment + identifier: "{{ var('mailchimp_segment_identifier', 'segment')}}" description: Each record represents a segment in Mailchimp. columns: - name: id description: The ID for the Segment from Mailchimp - - name: list_id description: The ID of the List the segment is part of. - - name: member_count description: The number of members in the segment. - - name: name description: The name of the segment. - - name: type description: The type of segment - - name: updated_at description: The date and time the segment was last updated. - - name: created_at description: The date and time the segment was created. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: _fivetran_deleted description: Boolean that is true if the row has been soft-deleted from the source. - - name: segment_member + identifier: "{{ var('mailchimp_segment_member_identifier', 'segment_member')}}" description: Each record represents a member and their segment data. columns: - name: segment_id description: The ID for the Segment from Mailchimp. - - name: member_id description: The ID of the member. - - name: list_id description: The ID of the List the segment is part of. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: _fivetran_deleted description: Boolean that is true if the row has been soft-deleted from the source. - name: list + identifier: "{{ var('mailchimp_list_identifier', 'list')}}" description: Each record represents a list in Mailchimp. columns: - name: id description: The unique ID of a list. - - name: date_created description: The date and time that a list was created. - - name: name description: The name of a list. - - name: list_rating description: An auto-generated activity score for the list (0-5). - - name: beamer_address description: The list's email beamer address. - - name: contact_address_1 description: The street address for the list contact. - - name: contact_address_2 description: The street address for the list contact. - - name: contact_city description: The city for the list contact. - - name: contact_company description: The company name for the list. - - name: contact_country description: A two-character ISO3166 country code. Defaults to US if invalid. - - name: contact_state description: The state for the list contact. - - name: contact_zip description: The postal or zip code for the list contact. - - name: default_from_email description: The default from email for campaigns sent to a list. - - name: default_from_name description: The default from name for campaigns sent to a list. - - name: default_language description: The default language for a lists's forms. - - name: default_subject description: The default subject line for campaigns sent to a list. - - name: email_type_option description: > Whether the list supports multiple formats for emails. When set to true, subscribers can choose whether they want to receive HTML or plain-text emails. When set to false, subscribers will receive HTML emails, with a plain-text alternative backup. - - name: notify_on_subscribe description: The email address to send subscribe notifications to. - - name: notify_on_unsubscribe description: The email address to send unsubscribe notifications to. - - name: permission_reminder description: The permission reminder for a list. - - name: subscribe_url_long description: The full version of a list's subscribe form (host will vary). - - name: subscribe_url_short description: Mailchimp's EepURL shortened version of a list's subscribe form. - - name: use_archive_bar description: Whether campaigns for this list use the Archive Bar in archives by default. - - name: visibility description: Whether this list is public or private. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - - name: _fivetran_deleted description: Boolean that is true if the row has been soft-deleted from the source. - name: member + identifier: "{{ var('mailchimp_member_identifier', 'member')}}" description: > Each record represents a member in Mailchimp. Note that this table may contain custom metadata columns which can be passed through via `mailchimp__members_pass_through_columns`. columns: - name: id description: The ID of the member. - - name: email_address description: Email address for a subscriber. - - name: email_client description: The list member's email client. - - name: email_type description: Type of email this member asked to get ('html' or 'text'). - - name: status description: > Subscriber's current status. Possible Values: subscribed, unsubscribed, cleaned, pending, transactional, archived - - name: list_id description: The ID of the list the member belongs to. - - name: timestamp_signup description: The date and time the subscriber signed up for the list. - - name: timestamp_opt description: The date and time the subscribe confirmed their opt-in status. - - name: last_changed description: The date and time the member's info was last changed. - name: country_code description: The member's unique code for the location country. - - name: dstoff description: The member's offset for timezones where daylight saving time is observed. - - name: gmtoff description: The member's time difference in hours from GMT. - - name: ip_opt description: The IP address the subscriber used to confirm their opt-in status. - - name: ip_signup description: IP address the subscriber signed up from. - - name: language description: If set/detected, the subscriber's language. - - name: latitude description: The member's location latitude. - - name: longitude description: The member's location longitude. - - name: member_rating description: Star rating for this member, between 1 and 5. - - name: timezone description: The timezone for the member's location. - - name: unique_email_id description: An identifier for the address across all of Mailchimp. - - name: vip description: VIP status for subscriber. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. - name: unsubscribe + identifier: "{{ var('mailchimp_unsubscribe_identifier', 'unsubscribe')}}" description: Each record represents a member who unsubscribed. columns: - name: campaign_id description: The unique id for the campaign. - - name: member_id description: The ID of the member an email was sent to. - - name: list_id description: The unique ID for the list. - - name: reason description: Field expressing unsubscribe reason. - - name: timestamp description: The time and date the member unsubscribed. - - name: _fivetran_synced description: UTC timestamp that indicates the time when Fivetran last successfully synced the row. diff --git a/models/stg_mailchimp__automation_activities.sql b/models/stg_mailchimp__automation_activities.sql index 3fee0bb..ec82870 100644 --- a/models/stg_mailchimp__automation_activities.sql +++ b/models/stg_mailchimp__automation_activities.sql @@ -40,7 +40,7 @@ unique_key as ( select *, - {{ dbt_utils.surrogate_key(['action_type', 'automation_email_id', 'member_id', 'activity_timestamp']) }} as activity_id + {{ dbt_utils.generate_surrogate_key(['action_type', 'automation_email_id', 'member_id', 'activity_timestamp']) }} as activity_id from final ) diff --git a/models/stg_mailchimp__automation_recipients.sql b/models/stg_mailchimp__automation_recipients.sql index 8843d11..3509691 100644 --- a/models/stg_mailchimp__automation_recipients.sql +++ b/models/stg_mailchimp__automation_recipients.sql @@ -36,7 +36,7 @@ final as ( select *, - {{ dbt_utils.surrogate_key(['member_id','automation_email_id']) }} as automation_recipient_id + {{ dbt_utils.generate_surrogate_key(['member_id','automation_email_id']) }} as automation_recipient_id from final ) diff --git a/models/stg_mailchimp__campaign_activities.sql b/models/stg_mailchimp__campaign_activities.sql index f52e82d..a569754 100644 --- a/models/stg_mailchimp__campaign_activities.sql +++ b/models/stg_mailchimp__campaign_activities.sql @@ -38,8 +38,8 @@ final as ( select *, - {{ dbt_utils.surrogate_key(['action_type', 'campaign_id', 'member_id', 'activity_timestamp']) }} as activity_id, - {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id + {{ dbt_utils.generate_surrogate_key(['action_type', 'campaign_id', 'member_id', 'activity_timestamp']) }} as activity_id, + {{ dbt_utils.generate_surrogate_key(['campaign_id','member_id']) }} as email_id from final ) diff --git a/models/stg_mailchimp__campaign_recipients.sql b/models/stg_mailchimp__campaign_recipients.sql index 954abfe..1c8e174 100644 --- a/models/stg_mailchimp__campaign_recipients.sql +++ b/models/stg_mailchimp__campaign_recipients.sql @@ -34,7 +34,7 @@ unique_key as ( select *, - {{ dbt_utils.surrogate_key(['campaign_id','member_id']) }} as email_id + {{ dbt_utils.generate_surrogate_key(['campaign_id','member_id']) }} as email_id from final ) diff --git a/models/stg_mailchimp__unsubscribes.sql b/models/stg_mailchimp__unsubscribes.sql index fdd332f..beae7d4 100644 --- a/models/stg_mailchimp__unsubscribes.sql +++ b/models/stg_mailchimp__unsubscribes.sql @@ -36,7 +36,7 @@ unique_key as ( select *, - {{ dbt_utils.surrogate_key([ 'member_id', 'list_id', 'unsubscribe_timestamp']) }} as unsubscribe_id + {{ dbt_utils.generate_surrogate_key([ 'member_id', 'list_id', 'unsubscribe_timestamp']) }} as unsubscribe_id from final ) diff --git a/packages.yml b/packages.yml index e8d9d9e..8911cb1 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - package: fivetran/fivetran_utils - version: [">=0.3.0", "<0.4.0"] + version: [">=0.4.0", "<0.5.0"]