From bb1e42d576c531d17f5af9c536f14d00341fbb75 Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Mon, 23 May 2022 13:47:00 -0500 Subject: [PATCH 1/3] initial review notes and edits --- .github/ISSUE_TEMPLATE/config.yml | 3 ++ .github/pull_request_template.md | 1 - README.md | 17 +++++---- integration_tests/dbt_project.yml | 37 +++++++++---------- models/apple_store__app_version_report.sql | 3 +- models/apple_store__device_report.sql | 3 +- models/apple_store__overview_report.sql | 3 +- .../apple_store__platform_version_report.sql | 3 +- models/apple_store__source_type_report.sql | 3 +- models/apple_store__subscription_report.sql | 3 +- models/apple_store__territory_report.sql | 3 +- .../int_apple_store__crashes_app_version.sql | 3 +- .../int_apple_store__crashes_device.sql | 3 +- .../int_apple_store__subscription_device.sql | 4 +- .../int_apple_store__app_store_overview.sql | 4 +- .../int_apple_store__crashes_overview.sql | 3 +- .../int_apple_store__downloads_overview.sql | 3 +- ...ple_store__sales_subscription_overview.sql | 3 +- .../int_apple_store__usage_overview.sql | 3 +- .../int_apple_store__platform_version.sql | 3 +- ...int_apple_store__app_store_source_type.sql | 4 +- ...int_apple_store__downloads_source_type.sql | 3 +- .../int_apple_store__usage_source_type.sql | 3 +- ...apple_store__sales_subscription_events.sql | 3 +- ...pple_store__sales_subscription_summary.sql | 3 +- 25 files changed, 71 insertions(+), 53 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 65a074b..4264c49 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,7 @@ contact_links: + - name: Provide feedback to our dbt package team + url: https://www.surveymonkey.com/r/DQ7K7WW + about: Fill out our survey form to provide valuable feedback to the Fivetran team developing and maintaining the dbt packages. - name: Ask a question during our office hours url: https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours about: Schedule time during the external office hours block with the Fivetran Analytics Engineering team for support diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 35f658d..f450926 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?** diff --git a/README.md b/README.md index 96eca24..eb6d38e 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ The following table provides a detailed list of all models materialized within t | **model** | **description** | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [apple_store__app_version_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__app_version_report.sql) | Each record represents daily metrics for each by app_id, source_type and app version. | -| [apple_store__device_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__device_report.sql) | Each record represents daily subscription metrics by app_id, source_type and device. | -| [apple_store__overview_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__overview_report.sql) | Each record represents daily metrics for each app_id. | -| [apple_store__platform_version_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__platform_version_report.sql) | Each record represents daily metrics for each by app_id, source_type and platform version. | -| [apple_store__source_type_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__source_type_report.sql) | Each record represents daily metrics by app_id and source_type. | -| [apple_store__subscription_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__subscription_report.sql) | Each record represents daily subscription metrics by account, app, subscription name, country and state. | -| [apple_store__territory_report](https://github.com/fivetran/dbt_apple_store/blob/main/models/apple_store__territory_report.sql) | Each record represents daily subscription metrics by app_id, source_type and territory. | +| [apple_store__app_version_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__app_version_report) | Each record represents daily metrics for each by app_id, source_type and app version. | +| [apple_store__device_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__device_report) | Each record represents daily subscription metrics by app_id, source_type and device. | +| [apple_store__overview_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__overview_report) | Each record represents daily metrics for each app_id. | +| [apple_store__platform_version_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__platform_version_report) | Each record represents daily metrics for each by app_id, source_type and platform version. | +| [apple_store__source_type_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__source_type_report) | Each record represents daily metrics by app_id and source_type. | +| [apple_store__subscription_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__subscription_report) | Each record represents daily subscription metrics by account, app, subscription name, country and state. | +| [apple_store__territory_report](https://fivetran.github.io/dbt_apple_store/#!/model/model.apple_store.apple_store__source_type_report) | Each record represents daily subscription metrics by app_id, source_type and territory. | # 🎯 How do I use the dbt package? @@ -101,7 +101,7 @@ If an individual source table has a different name than the package expects, add ```yml vars: - apple_store__identifier: your_table_name + _identifier: your_table_name ``` @@ -136,6 +136,7 @@ A small team of analytics engineers at Fivetran develops these dbt packages. How We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package! +## Opinionated Decisions # 🏪 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_apple_store/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). diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 341dbf5..9602d5f 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -6,27 +6,24 @@ version: '0.1.0' profile: 'integration_tests' vars: + apple_store_schema: apple_store_integration_tests apple_store_source: - app: "{{ ref('app') }}" - app_store_device: "{{ ref('app_store_source_type_device') }}" - usage_device: "{{ ref('usage_source_type_device') }}" - downloads_device: "{{ ref('downloads_source_type_device') }}" - - app_store_territory: "{{ ref('app_store_territory_source_type') }}" - downloads_territory: "{{ ref('downloads_territory_source_type') }}" - usage_territory: "{{ ref('usage_territory_source_type') }}" - - app_store_platform_version: "{{ ref('app_store_platform_version_source_type') }}" - crashes_platform_version: "{{ ref('crashes_platform_version') }}" - downloads_platform_version: "{{ ref('downloads_platform_version_source_type') }}" - usage_platform_version: "{{ ref('usage_platform_version_source_type') }}" - - crashes_app_version: "{{ ref('crashes_app_version') }}" - usage_app_version: "{{ ref('usage_app_version_source_type') }}" - - sales_account: "{{ ref('sales_account') }}" - sales_subscription_events: "{{ ref('sales_subscription_events') }}" - sales_subscription_summary: "{{ ref('sales_subscription_summary') }}" + app_identifier: "app" + app_store_platform_version_source_type_report_identifier: "app_store_platform_version_source_type" + app_store_source_type_device_report_identifier: "app_store_source_type_device" + app_store_territory_source_type_report_identifier: "app_store_territory_source_type" + crashes_app_version_device_report_identifier: "crashes_app_version" + crashes_platform_version_device_report_identifier: "crashes_platform_version" + downloads_platform_version_source_type_report_identifier: "downloads_platform_version_source_type" + downloads_source_type_device_report_identifier: "downloads_source_type_device" + downloads_territory_source_type_report_identifier: "downloads_territory_source_type" + sales_account_identifier: "sales_account" + sales_subscription_event_summary_identifier: "sales_subscription_events" + sales_subscription_summary_identifier: "sales_subscription_summary" + usage_app_version_source_type_report_identifier: "usage_app_version_source_type" + usage_platform_version_source_type_report_identifier: "usage_platform_version_source_type" + usage_source_type_device_report_identifier: "usage_source_type_device" + usage_territory_source_type_report_identifier: "usage_territory_source_type" apple_store__subscription_events: - 'Renew' diff --git a/models/apple_store__app_version_report.sql b/models/apple_store__app_version_report.sql index 95546c8..ac34b1d 100644 --- a/models/apple_store__app_version_report.sql +++ b/models/apple_store__app_version_report.sql @@ -69,4 +69,5 @@ joined as ( and reporting_grain.app_version = usage_app_version_report.app_version ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/apple_store__device_report.sql b/models/apple_store__device_report.sql index 45f6e0f..46845c4 100644 --- a/models/apple_store__device_report.sql +++ b/models/apple_store__device_report.sql @@ -125,4 +125,5 @@ joined as ( and reporting_grain.device = usage_device.device ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/apple_store__overview_report.sql b/models/apple_store__overview_report.sql index 66de322..ff658e0 100644 --- a/models/apple_store__overview_report.sql +++ b/models/apple_store__overview_report.sql @@ -94,4 +94,5 @@ joined as ( and reporting_grain.app_id = usage.app_id ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/apple_store__platform_version_report.sql b/models/apple_store__platform_version_report.sql index 4a72723..87a50d8 100644 --- a/models/apple_store__platform_version_report.sql +++ b/models/apple_store__platform_version_report.sql @@ -99,4 +99,5 @@ joined as ( and reporting_grain.platform_version = usage_platform_version.platform_version ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/apple_store__source_type_report.sql b/models/apple_store__source_type_report.sql index 92717e7..80cd070 100644 --- a/models/apple_store__source_type_report.sql +++ b/models/apple_store__source_type_report.sql @@ -64,4 +64,5 @@ joined as ( and reporting_grain.source_type = usage_source_type.source_type ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/apple_store__subscription_report.sql b/models/apple_store__subscription_report.sql index b9e235e..5bb3e90 100644 --- a/models/apple_store__subscription_report.sql +++ b/models/apple_store__subscription_report.sql @@ -96,4 +96,5 @@ joined as ( ) -select * from joined +select * +from joined diff --git a/models/apple_store__territory_report.sql b/models/apple_store__territory_report.sql index e1aa40c..5a0d99d 100644 --- a/models/apple_store__territory_report.sql +++ b/models/apple_store__territory_report.sql @@ -85,4 +85,5 @@ joined as ( on reporting_grain.territory = alternative_country_codes.alternative_country_name ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql b/models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql index c077411..fbbf90c 100644 --- a/models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql +++ b/models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql @@ -16,4 +16,5 @@ aggregated as ( {{ dbt_utils.group_by(4) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/device_report/int_apple_store__crashes_device.sql b/models/intermediate/device_report/int_apple_store__crashes_device.sql index 5f22ccd..c27e943 100644 --- a/models/intermediate/device_report/int_apple_store__crashes_device.sql +++ b/models/intermediate/device_report/int_apple_store__crashes_device.sql @@ -16,4 +16,5 @@ aggregated as ( {{ dbt_utils.group_by(4) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/device_report/int_apple_store__subscription_device.sql b/models/intermediate/device_report/int_apple_store__subscription_device.sql index 8a24d89..261fc40 100644 --- a/models/intermediate/device_report/int_apple_store__subscription_device.sql +++ b/models/intermediate/device_report/int_apple_store__subscription_device.sql @@ -65,7 +65,7 @@ joined as ( and subscription_summary.device = pivoted_subscription_events.device left join app on subscription_summary.app_name = app.app_name - ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/intermediate/overview_report/int_apple_store__app_store_overview.sql b/models/intermediate/overview_report/int_apple_store__app_store_overview.sql index a38a96e..21f3903 100644 --- a/models/intermediate/overview_report/int_apple_store__app_store_overview.sql +++ b/models/intermediate/overview_report/int_apple_store__app_store_overview.sql @@ -13,7 +13,7 @@ aggregated as ( sum(page_views) as page_views from base {{ dbt_utils.group_by(2) }} - ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/overview_report/int_apple_store__crashes_overview.sql b/models/intermediate/overview_report/int_apple_store__crashes_overview.sql index ad088a5..2ad30d6 100644 --- a/models/intermediate/overview_report/int_apple_store__crashes_overview.sql +++ b/models/intermediate/overview_report/int_apple_store__crashes_overview.sql @@ -14,4 +14,5 @@ aggregated as ( {{ dbt_utils.group_by(2) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/overview_report/int_apple_store__downloads_overview.sql b/models/intermediate/overview_report/int_apple_store__downloads_overview.sql index ccbb116..8539d4f 100644 --- a/models/intermediate/overview_report/int_apple_store__downloads_overview.sql +++ b/models/intermediate/overview_report/int_apple_store__downloads_overview.sql @@ -16,4 +16,5 @@ aggregated as ( {{ dbt_utils.group_by(2) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql b/models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql index 110a46d..77ce80e 100644 --- a/models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql +++ b/models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql @@ -41,4 +41,5 @@ joined as ( and subscription_summary.app_id = subscription_events.app_id ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/intermediate/overview_report/int_apple_store__usage_overview.sql b/models/intermediate/overview_report/int_apple_store__usage_overview.sql index 36ca775..6289351 100644 --- a/models/intermediate/overview_report/int_apple_store__usage_overview.sql +++ b/models/intermediate/overview_report/int_apple_store__usage_overview.sql @@ -17,4 +17,5 @@ aggregated as ( {{ dbt_utils.group_by(2) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/platform_version_report/int_apple_store__platform_version.sql b/models/intermediate/platform_version_report/int_apple_store__platform_version.sql index 94855fd..38d9dd6 100644 --- a/models/intermediate/platform_version_report/int_apple_store__platform_version.sql +++ b/models/intermediate/platform_version_report/int_apple_store__platform_version.sql @@ -16,4 +16,5 @@ aggregated as ( {{ dbt_utils.group_by(4) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql b/models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql index 7fa7c5a..eaef559 100644 --- a/models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql +++ b/models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql @@ -14,7 +14,7 @@ aggregated as ( sum(page_views) as page_views from base {{ dbt_utils.group_by(3) }} - ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql b/models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql index a686c06..289b40b 100644 --- a/models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql +++ b/models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql @@ -17,4 +17,5 @@ aggregated as ( {{ dbt_utils.group_by(3) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/source_type_report/int_apple_store__usage_source_type.sql b/models/intermediate/source_type_report/int_apple_store__usage_source_type.sql index 5b3be93..1636736 100644 --- a/models/intermediate/source_type_report/int_apple_store__usage_source_type.sql +++ b/models/intermediate/source_type_report/int_apple_store__usage_source_type.sql @@ -18,4 +18,5 @@ aggregated as ( {{ dbt_utils.group_by(3) }} ) -select * from aggregated \ No newline at end of file +select * +from aggregated \ No newline at end of file diff --git a/models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql b/models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql index 5ea1bd6..ce3942a 100644 --- a/models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql +++ b/models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql @@ -70,4 +70,5 @@ joined as ( on pivoted.account_id = sales_account.account_id ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file diff --git a/models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql b/models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql index ca83317..e2f90b9 100644 --- a/models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql +++ b/models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql @@ -41,4 +41,5 @@ joined as ( {{ dbt_utils.group_by(8) }} ) -select * from joined \ No newline at end of file +select * +from joined \ No newline at end of file From b7ebe7038611563e70a547f2c5727d4b25b1c938 Mon Sep 17 00:00:00 2001 From: fivetran-sheringuyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Tue, 31 May 2022 17:14:19 -0500 Subject: [PATCH 2/3] dev pr updates --- README.md | 2 ++ docs/catalog.json | 2 +- docs/manifest.json | 2 +- docs/run_results.json | 2 +- integration_tests/dbt_project.yml | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eb6d38e..7af8a8d 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,8 @@ A small team of analytics engineers at Fivetran develops these dbt packages. How We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package! ## Opinionated Decisions +In creating this package, which is meant for a wide range of use cases, we had to take opinionated stances on a few different questions we came across during development. We've consolidated significant choices we made in the [DECISIONLOG.md](https://github.com/fivetran/dbt_apple_store/blob/main/DECISIONLOG.md), and will continue to update as the package evolves. We are always open to and encourage feedback on these choices, and the package in general. + # 🏪 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_apple_store/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). diff --git a/docs/catalog.json b/docs/catalog.json index 50479ee..00a257e 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.0.0", "generated_at": "2022-05-19T18:11:53.532880Z", "invocation_id": "6fb5cc63-8a97-47af-b1a5-83f20142fb33", "env": {}}, "nodes": {"seed.apple_store_integration_tests.app_store_source_type_device": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app_store_source_type_device", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 8, "name": "impressions_unique_device", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 806.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app_store_source_type_device"}, "seed.apple_store_integration_tests.app": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "is_enabled": {"type": "BOOL", "index": 2, "name": "is_enabled", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "asset_token": {"type": "STRING", "index": 4, "name": "asset_token", "comment": null}, "pre_order_info": {"type": "INT64", "index": 5, "name": "pre_order_info", "comment": null}, "icon_url": {"type": "STRING", "index": 6, "name": "icon_url", "comment": null}, "app_opt_in_rate": {"type": "INT64", "index": 7, "name": "app_opt_in_rate", "comment": null}, "ios": {"type": "BOOL", "index": 8, "name": "ios", "comment": null}, "tvos": {"type": "BOOL", "index": 9, "name": "tvos", "comment": null}, "is_bundle": {"type": "BOOL", "index": 10, "name": "is_bundle", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 11, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 82.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app"}, "seed.apple_store_integration_tests.usage_platform_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_platform_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 900.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_platform_version_source_type"}, "seed.apple_store_integration_tests.sales_subscription_summary": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "sales_subscription_summary", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_filename": {"type": "STRING", "index": 1, "name": "_filename", "comment": null}, "account_number": {"type": "INT64", "index": 2, "name": "account_number", "comment": null}, "vendor_number": {"type": "INT64", "index": 3, "name": "vendor_number", "comment": null}, "_index": {"type": "INT64", "index": 4, "name": "_index", "comment": null}, "developer_proceeds": {"type": "FLOAT64", "index": 5, "name": "developer_proceeds", "comment": null}, "app_name": {"type": "STRING", "index": 6, "name": "app_name", "comment": null}, "free_trial_promotional_offer_subscriptions": {"type": "INT64", "index": 7, "name": "free_trial_promotional_offer_subscriptions", "comment": null}, "proceeds_currency": {"type": "STRING", "index": 8, "name": "proceeds_currency", "comment": null}, "subscription_name": {"type": "STRING", "index": 9, "name": "subscription_name", "comment": null}, "pay_as_you_go_promotional_offer_subscriptions": {"type": "INT64", "index": 10, "name": "pay_as_you_go_promotional_offer_subscriptions", "comment": null}, "customer_currency": {"type": "STRING", "index": 11, "name": "customer_currency", "comment": null}, "marketing_opt_ins": {"type": "INT64", "index": 12, "name": "marketing_opt_ins", "comment": null}, "pay_up_front_promotional_offer_subscriptions": {"type": "INT64", "index": 13, "name": "pay_up_front_promotional_offer_subscriptions", "comment": null}, "billing_retry": {"type": "INT64", "index": 14, "name": "billing_retry", "comment": null}, "proceeds_reason": {"type": "STRING", "index": 15, "name": "proceeds_reason", "comment": null}, "subscription_apple_id": {"type": "INT64", "index": 16, "name": "subscription_apple_id", "comment": null}, "active_standard_price_subscriptions": {"type": "INT64", "index": 17, "name": "active_standard_price_subscriptions", "comment": null}, "standard_subscription_duration": {"type": "STRING", "index": 18, "name": "standard_subscription_duration", "comment": null}, "grace_period": {"type": "INT64", "index": 19, "name": "grace_period", "comment": null}, "device": {"type": "STRING", "index": 20, "name": "device", "comment": null}, "active_pay_up_front_introductory_offer_subscriptions": {"type": "INT64", "index": 21, "name": "active_pay_up_front_introductory_offer_subscriptions", "comment": null}, "customer_price": {"type": "FLOAT64", "index": 22, "name": "customer_price", "comment": null}, "promotional_offer_name": {"type": "INT64", "index": 23, "name": "promotional_offer_name", "comment": null}, "state": {"type": "STRING", "index": 24, "name": "state", "comment": null}, "active_pay_as_you_go_introductory_offer_subscriptions": {"type": "INT64", "index": 25, "name": "active_pay_as_you_go_introductory_offer_subscriptions", "comment": null}, "subscription_group_id": {"type": "INT64", "index": 26, "name": "subscription_group_id", "comment": null}, "country": {"type": "STRING", "index": 27, "name": "country", "comment": null}, "active_free_trial_introductory_offer_subscriptions": {"type": "INT64", "index": 28, "name": "active_free_trial_introductory_offer_subscriptions", "comment": null}, "promotional_offer_id": {"type": "INT64", "index": 29, "name": "promotional_offer_id", "comment": null}, "app_apple_id": {"type": "INT64", "index": 30, "name": "app_apple_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 31, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2678.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.sales_subscription_summary"}, "seed.apple_store_integration_tests.usage_territory_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_territory_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 882.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_territory_source_type"}, "seed.apple_store_integration_tests.crashes_platform_version": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "crashes_platform_version", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "platform_version": {"type": "STRING", "index": 4, "name": "platform_version", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "crashes": {"type": "INT64", "index": 6, "name": "crashes", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 488.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.crashes_platform_version"}, "seed.apple_store_integration_tests.usage_source_type_device": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_source_type_device", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 877.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_source_type_device"}, "seed.apple_store_integration_tests.app_store_platform_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app_store_platform_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 8, "name": "impressions_unique_device", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 810.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app_store_platform_version_source_type"}, "seed.apple_store_integration_tests.sales_subscription_events": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "sales_subscription_events", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_filename": {"type": "STRING", "index": 1, "name": "_filename", "comment": null}, "account_number": {"type": "INT64", "index": 2, "name": "account_number", "comment": null}, "vendor_number": {"type": "INT64", "index": 3, "name": "vendor_number", "comment": null}, "_index": {"type": "INT64", "index": 4, "name": "_index", "comment": null}, "event_date": {"type": "DATE", "index": 5, "name": "event_date", "comment": null}, "app_name": {"type": "STRING", "index": 6, "name": "app_name", "comment": null}, "days_canceled": {"type": "INT64", "index": 7, "name": "days_canceled", "comment": null}, "subscription_name": {"type": "STRING", "index": 8, "name": "subscription_name", "comment": null}, "consecutive_paid_periods": {"type": "INT64", "index": 9, "name": "consecutive_paid_periods", "comment": null}, "previous_subscription_name": {"type": "INT64", "index": 10, "name": "previous_subscription_name", "comment": null}, "cancellation_reason": {"type": "STRING", "index": 11, "name": "cancellation_reason", "comment": null}, "proceeds_reason": {"type": "STRING", "index": 12, "name": "proceeds_reason", "comment": null}, "subscription_apple_id": {"type": "INT64", "index": 13, "name": "subscription_apple_id", "comment": null}, "standard_subscription_duration": {"type": "STRING", "index": 14, "name": "standard_subscription_duration", "comment": null}, "original_start_date": {"type": "DATE", "index": 15, "name": "original_start_date", "comment": null}, "device": {"type": "STRING", "index": 16, "name": "device", "comment": null}, "days_before_canceling": {"type": "INT64", "index": 17, "name": "days_before_canceling", "comment": null}, "quantity": {"type": "INT64", "index": 18, "name": "quantity", "comment": null}, "marketing_opt_in_duration": {"type": "INT64", "index": 19, "name": "marketing_opt_in_duration", "comment": null}, "promotional_offer_name": {"type": "INT64", "index": 20, "name": "promotional_offer_name", "comment": null}, "state": {"type": "STRING", "index": 21, "name": "state", "comment": null}, "previous_subscription_apple_id": {"type": "INT64", "index": 22, "name": "previous_subscription_apple_id", "comment": null}, "event": {"type": "STRING", "index": 23, "name": "event", "comment": null}, "subscription_group_id": {"type": "INT64", "index": 24, "name": "subscription_group_id", "comment": null}, "country": {"type": "STRING", "index": 25, "name": "country", "comment": null}, "promotional_offer_id": {"type": "INT64", "index": 26, "name": "promotional_offer_id", "comment": null}, "app_apple_id": {"type": "INT64", "index": 27, "name": "app_apple_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 28, "name": "_fivetran_synced", "comment": null}, "subscription_offer_type": {"type": "INT64", "index": 29, "name": "subscription_offer_type", "comment": null}, "subscription_offer_duration": {"type": "INT64", "index": 30, "name": "subscription_offer_duration", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2181.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.sales_subscription_events"}, "seed.apple_store_integration_tests.downloads_platform_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "downloads_platform_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 735.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.downloads_platform_version_source_type"}, "seed.apple_store_integration_tests.sales_account": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "sales_account", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 33.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.sales_account"}, "seed.apple_store_integration_tests.app_store_territory_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app_store_territory_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 8, "name": "impressions_unique_device", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 812.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app_store_territory_source_type"}, "seed.apple_store_integration_tests.usage_app_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_app_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "app_version": {"type": "STRING", "index": 2, "name": "app_version", "comment": null}, "date": {"type": "TIMESTAMP", "index": 3, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 953.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_app_version_source_type"}, "seed.apple_store_integration_tests.downloads_territory_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "downloads_territory_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 725.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.downloads_territory_source_type"}, "seed.apple_store_integration_tests.crashes_app_version": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "crashes_app_version", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "app_version": {"type": "STRING", "index": 2, "name": "app_version", "comment": null}, "date": {"type": "TIMESTAMP", "index": 3, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 4, "name": "device", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "crashes": {"type": "INT64", "index": 6, "name": "crashes", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 530.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.crashes_app_version"}, "seed.apple_store_integration_tests.downloads_source_type_device": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "downloads_source_type_device", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 734.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.downloads_source_type_device"}, "seed.apple_store_source.apple_store_country_codes": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests_apple_store_source", "name": "apple_store_country_codes", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"country_name": {"type": "STRING", "index": 1, "name": "country_name", "comment": null}, "alternative_country_name": {"type": "STRING", "index": 2, "name": "alternative_country_name", "comment": null}, "country_code_numeric": {"type": "INT64", "index": 3, "name": "country_code_numeric", "comment": null}, "country_code_alpha_2": {"type": "STRING", "index": 4, "name": "country_code_alpha_2", "comment": null}, "country_code_alpha_3": {"type": "STRING", "index": 5, "name": "country_code_alpha_3", "comment": null}, "region": {"type": "STRING", "index": 6, "name": "region", "comment": null}, "region_code": {"type": "INT64", "index": 7, "name": "region_code", "comment": null}, "sub_region": {"type": "STRING", "index": 8, "name": "sub_region", "comment": null}, "sub_region_code": {"type": "INT64", "index": 9, "name": "sub_region_code", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18745.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 249.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_source.apple_store_country_codes"}}, "sources": {"source.apple_store_source.apple_store.sales_account": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "sales_account", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 35.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.sales_account"}, "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "app_store_platform_version_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 7, "name": "impressions_unique_device", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 8, "name": "meets_threshold", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1991330.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 23550.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.app_store_platform_version_source_type_report"}, "source.apple_store_source.apple_store.app_store_source_type_device_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "app_store_source_type_device_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 7, "name": "impressions_unique_device", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 8, "name": "meets_threshold", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 839132.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10424.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.app_store_source_type_device_report"}, "source.apple_store_source.apple_store.app_store_territory_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "app_store_territory_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 7, "name": "impressions_unique_device", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 8, "name": "meets_threshold", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3982512.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46943.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.app_store_territory_source_type_report"}, "source.apple_store_source.apple_store.crashes_platform_version_device_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "crashes_platform_version_device_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "platform_version": {"type": "STRING", "index": 4, "name": "platform_version", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "crashes": {"type": "INT64", "index": 6, "name": "crashes", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 7, "name": "meets_threshold", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1318275.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 26155.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.crashes_platform_version_device_report"}, "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "downloads_platform_version_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 7, "name": "meets_threshold", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1996196.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 26060.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.downloads_platform_version_source_type_report"}, "source.apple_store_source.apple_store.app": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "app", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "app_opt_in_rate": {"type": "INT64", "index": 3, "name": "app_opt_in_rate", "comment": null}, "asset_token": {"type": "STRING", "index": 4, "name": "asset_token", "comment": null}, "icon_url": {"type": "STRING", "index": 5, "name": "icon_url", "comment": null}, "ios": {"type": "BOOL", "index": 6, "name": "ios", "comment": null}, "is_bundle": {"type": "BOOL", "index": 7, "name": "is_bundle", "comment": null}, "is_enabled": {"type": "BOOL", "index": 8, "name": "is_enabled", "comment": null}, "name": {"type": "STRING", "index": 9, "name": "name", "comment": null}, "pre_order_info": {"type": "STRING", "index": 10, "name": "pre_order_info", "comment": null}, "tvos": {"type": "BOOL", "index": 11, "name": "tvos", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 393.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.app"}, "source.apple_store_source.apple_store.downloads_source_type_device_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "downloads_source_type_device_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 7, "name": "meets_threshold", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 755740.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10424.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.downloads_source_type_device_report"}, "source.apple_store_source.apple_store.usage_app_version_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "usage_app_version_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "app_version": {"type": "STRING", "index": 2, "name": "app_version", "comment": null}, "date": {"type": "TIMESTAMP", "index": 3, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "active_devices": {"type": "INT64", "index": 6, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 7, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 8, "name": "deletions", "comment": null}, "installations": {"type": "INT64", "index": 9, "name": "installations", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 10, "name": "meets_threshold", "comment": null}, "sessions": {"type": "INT64", "index": 11, "name": "sessions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2192462.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 23589.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.usage_app_version_source_type_report"}, "source.apple_store_source.apple_store.crashes_app_version_device_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "crashes_app_version_device_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "app_version": {"type": "STRING", "index": 2, "name": "app_version", "comment": null}, "date": {"type": "TIMESTAMP", "index": 3, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 4, "name": "device", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "crashes": {"type": "INT64", "index": 6, "name": "crashes", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 7, "name": "meets_threshold", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1258215.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 23445.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.crashes_app_version_device_report"}, "source.apple_store_source.apple_store.usage_territory_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "usage_territory_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "active_devices": {"type": "INT64", "index": 6, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 7, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 8, "name": "deletions", "comment": null}, "installations": {"type": "INT64", "index": 9, "name": "installations", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 10, "name": "meets_threshold", "comment": null}, "sessions": {"type": "INT64", "index": 11, "name": "sessions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4356287.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46924.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.usage_territory_source_type_report"}, "source.apple_store_source.apple_store.usage_platform_version_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "usage_platform_version_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "active_devices": {"type": "INT64", "index": 6, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 7, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 8, "name": "deletions", "comment": null}, "installations": {"type": "INT64", "index": 9, "name": "installations", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 10, "name": "meets_threshold", "comment": null}, "sessions": {"type": "INT64", "index": 11, "name": "sessions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2179637.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 23549.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.usage_platform_version_source_type_report"}, "source.apple_store_source.apple_store.downloads_territory_source_type_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "downloads_territory_source_type_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 7, "name": "meets_threshold", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3607050.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46944.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.downloads_territory_source_type_report"}, "source.apple_store_source.apple_store.usage_source_type_device_report": {"metadata": {"type": "table", "schema": "itunes_connect", "name": "usage_source_type_device_report", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 5, "name": "_fivetran_synced", "comment": null}, "active_devices": {"type": "INT64", "index": 6, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 7, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 8, "name": "deletions", "comment": null}, "installations": {"type": "INT64", "index": 9, "name": "installations", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 10, "name": "meets_threshold", "comment": null}, "sessions": {"type": "INT64", "index": 11, "name": "sessions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 922170.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10420.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.apple_store_source.apple_store.usage_source_type_device_report"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.0.0", "generated_at": "2022-05-31T22:13:58.658583Z", "invocation_id": "155a3a3c-5eb4-42e2-a4c8-3b52c18055f6", "env": {}}, "nodes": {"seed.apple_store_integration_tests.usage_source_type_device": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_source_type_device", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 877.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_source_type_device"}, "seed.apple_store_integration_tests.sales_account": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "sales_account", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "name": {"type": "STRING", "index": 2, "name": "name", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 33.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.sales_account"}, "seed.apple_store_integration_tests.usage_territory_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_territory_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 882.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_territory_source_type"}, "seed.apple_store_integration_tests.crashes_platform_version": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "crashes_platform_version", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "platform_version": {"type": "STRING", "index": 4, "name": "platform_version", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "crashes": {"type": "INT64", "index": 6, "name": "crashes", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 488.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.crashes_platform_version"}, "seed.apple_store_integration_tests.downloads_territory_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "downloads_territory_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 725.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.downloads_territory_source_type"}, "seed.apple_store_integration_tests.sales_subscription_events": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "sales_subscription_events", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_filename": {"type": "STRING", "index": 1, "name": "_filename", "comment": null}, "account_number": {"type": "INT64", "index": 2, "name": "account_number", "comment": null}, "vendor_number": {"type": "INT64", "index": 3, "name": "vendor_number", "comment": null}, "_index": {"type": "INT64", "index": 4, "name": "_index", "comment": null}, "event_date": {"type": "DATE", "index": 5, "name": "event_date", "comment": null}, "app_name": {"type": "STRING", "index": 6, "name": "app_name", "comment": null}, "days_canceled": {"type": "INT64", "index": 7, "name": "days_canceled", "comment": null}, "subscription_name": {"type": "STRING", "index": 8, "name": "subscription_name", "comment": null}, "consecutive_paid_periods": {"type": "INT64", "index": 9, "name": "consecutive_paid_periods", "comment": null}, "previous_subscription_name": {"type": "INT64", "index": 10, "name": "previous_subscription_name", "comment": null}, "cancellation_reason": {"type": "STRING", "index": 11, "name": "cancellation_reason", "comment": null}, "proceeds_reason": {"type": "STRING", "index": 12, "name": "proceeds_reason", "comment": null}, "subscription_apple_id": {"type": "INT64", "index": 13, "name": "subscription_apple_id", "comment": null}, "standard_subscription_duration": {"type": "STRING", "index": 14, "name": "standard_subscription_duration", "comment": null}, "original_start_date": {"type": "DATE", "index": 15, "name": "original_start_date", "comment": null}, "device": {"type": "STRING", "index": 16, "name": "device", "comment": null}, "days_before_canceling": {"type": "INT64", "index": 17, "name": "days_before_canceling", "comment": null}, "quantity": {"type": "INT64", "index": 18, "name": "quantity", "comment": null}, "marketing_opt_in_duration": {"type": "INT64", "index": 19, "name": "marketing_opt_in_duration", "comment": null}, "promotional_offer_name": {"type": "INT64", "index": 20, "name": "promotional_offer_name", "comment": null}, "state": {"type": "STRING", "index": 21, "name": "state", "comment": null}, "previous_subscription_apple_id": {"type": "INT64", "index": 22, "name": "previous_subscription_apple_id", "comment": null}, "event": {"type": "STRING", "index": 23, "name": "event", "comment": null}, "subscription_group_id": {"type": "INT64", "index": 24, "name": "subscription_group_id", "comment": null}, "country": {"type": "STRING", "index": 25, "name": "country", "comment": null}, "promotional_offer_id": {"type": "INT64", "index": 26, "name": "promotional_offer_id", "comment": null}, "app_apple_id": {"type": "INT64", "index": 27, "name": "app_apple_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 28, "name": "_fivetran_synced", "comment": null}, "subscription_offer_type": {"type": "INT64", "index": 29, "name": "subscription_offer_type", "comment": null}, "subscription_offer_duration": {"type": "INT64", "index": 30, "name": "subscription_offer_duration", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2181.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.sales_subscription_events"}, "seed.apple_store_integration_tests.crashes_app_version": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "crashes_app_version", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "app_version": {"type": "STRING", "index": 2, "name": "app_version", "comment": null}, "date": {"type": "TIMESTAMP", "index": 3, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 4, "name": "device", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "crashes": {"type": "INT64", "index": 6, "name": "crashes", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 530.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.crashes_app_version"}, "seed.apple_store_integration_tests.downloads_platform_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "downloads_platform_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 735.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.downloads_platform_version_source_type"}, "seed.apple_store_integration_tests.usage_platform_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_platform_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 900.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_platform_version_source_type"}, "seed.apple_store_integration_tests.downloads_source_type_device": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "downloads_source_type_device", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "first_time_downloads": {"type": "INT64", "index": 6, "name": "first_time_downloads", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "redownloads": {"type": "INT64", "index": 8, "name": "redownloads", "comment": null}, "total_downloads": {"type": "INT64", "index": 9, "name": "total_downloads", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 734.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.downloads_source_type_device"}, "seed.apple_store_integration_tests.app": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "is_enabled": {"type": "BOOL", "index": 2, "name": "is_enabled", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "asset_token": {"type": "STRING", "index": 4, "name": "asset_token", "comment": null}, "pre_order_info": {"type": "INT64", "index": 5, "name": "pre_order_info", "comment": null}, "icon_url": {"type": "STRING", "index": 6, "name": "icon_url", "comment": null}, "app_opt_in_rate": {"type": "INT64", "index": 7, "name": "app_opt_in_rate", "comment": null}, "ios": {"type": "BOOL", "index": 8, "name": "ios", "comment": null}, "tvos": {"type": "BOOL", "index": 9, "name": "tvos", "comment": null}, "is_bundle": {"type": "BOOL", "index": 10, "name": "is_bundle", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 11, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 82.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 1.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app"}, "seed.apple_store_integration_tests.app_store_platform_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app_store_platform_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "platform_version": {"type": "STRING", "index": 3, "name": "platform_version", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 8, "name": "impressions_unique_device", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 810.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app_store_platform_version_source_type"}, "seed.apple_store_integration_tests.app_store_territory_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app_store_territory_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 3, "name": "source_type", "comment": null}, "territory": {"type": "STRING", "index": 4, "name": "territory", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 8, "name": "impressions_unique_device", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 812.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app_store_territory_source_type"}, "seed.apple_store_integration_tests.usage_app_version_source_type": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "usage_app_version_source_type", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "app_version": {"type": "STRING", "index": 2, "name": "app_version", "comment": null}, "date": {"type": "TIMESTAMP", "index": 3, "name": "date", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "installations": {"type": "INT64", "index": 6, "name": "installations", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "sessions": {"type": "INT64", "index": 8, "name": "sessions", "comment": null}, "active_devices": {"type": "INT64", "index": 9, "name": "active_devices", "comment": null}, "active_devices_last_30_days": {"type": "INT64", "index": 10, "name": "active_devices_last_30_days", "comment": null}, "deletions": {"type": "INT64", "index": 11, "name": "deletions", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 953.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.usage_app_version_source_type"}, "seed.apple_store_integration_tests.app_store_source_type_device": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "app_store_source_type_device", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"app_id": {"type": "INT64", "index": 1, "name": "app_id", "comment": null}, "date": {"type": "TIMESTAMP", "index": 2, "name": "date", "comment": null}, "device": {"type": "STRING", "index": 3, "name": "device", "comment": null}, "source_type": {"type": "STRING", "index": 4, "name": "source_type", "comment": null}, "meets_threshold": {"type": "BOOL", "index": 5, "name": "meets_threshold", "comment": null}, "impressions": {"type": "INT64", "index": 6, "name": "impressions", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 7, "name": "_fivetran_synced", "comment": null}, "impressions_unique_device": {"type": "INT64", "index": 8, "name": "impressions_unique_device", "comment": null}, "page_views": {"type": "INT64", "index": 9, "name": "page_views", "comment": null}, "page_views_unique_device": {"type": "INT64", "index": 10, "name": "page_views_unique_device", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 806.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.app_store_source_type_device"}, "seed.apple_store_integration_tests.sales_subscription_summary": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests", "name": "sales_subscription_summary", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"_filename": {"type": "STRING", "index": 1, "name": "_filename", "comment": null}, "account_number": {"type": "INT64", "index": 2, "name": "account_number", "comment": null}, "vendor_number": {"type": "INT64", "index": 3, "name": "vendor_number", "comment": null}, "_index": {"type": "INT64", "index": 4, "name": "_index", "comment": null}, "developer_proceeds": {"type": "FLOAT64", "index": 5, "name": "developer_proceeds", "comment": null}, "app_name": {"type": "STRING", "index": 6, "name": "app_name", "comment": null}, "free_trial_promotional_offer_subscriptions": {"type": "INT64", "index": 7, "name": "free_trial_promotional_offer_subscriptions", "comment": null}, "proceeds_currency": {"type": "STRING", "index": 8, "name": "proceeds_currency", "comment": null}, "subscription_name": {"type": "STRING", "index": 9, "name": "subscription_name", "comment": null}, "pay_as_you_go_promotional_offer_subscriptions": {"type": "INT64", "index": 10, "name": "pay_as_you_go_promotional_offer_subscriptions", "comment": null}, "customer_currency": {"type": "STRING", "index": 11, "name": "customer_currency", "comment": null}, "marketing_opt_ins": {"type": "INT64", "index": 12, "name": "marketing_opt_ins", "comment": null}, "pay_up_front_promotional_offer_subscriptions": {"type": "INT64", "index": 13, "name": "pay_up_front_promotional_offer_subscriptions", "comment": null}, "billing_retry": {"type": "INT64", "index": 14, "name": "billing_retry", "comment": null}, "proceeds_reason": {"type": "STRING", "index": 15, "name": "proceeds_reason", "comment": null}, "subscription_apple_id": {"type": "INT64", "index": 16, "name": "subscription_apple_id", "comment": null}, "active_standard_price_subscriptions": {"type": "INT64", "index": 17, "name": "active_standard_price_subscriptions", "comment": null}, "standard_subscription_duration": {"type": "STRING", "index": 18, "name": "standard_subscription_duration", "comment": null}, "grace_period": {"type": "INT64", "index": 19, "name": "grace_period", "comment": null}, "device": {"type": "STRING", "index": 20, "name": "device", "comment": null}, "active_pay_up_front_introductory_offer_subscriptions": {"type": "INT64", "index": 21, "name": "active_pay_up_front_introductory_offer_subscriptions", "comment": null}, "customer_price": {"type": "FLOAT64", "index": 22, "name": "customer_price", "comment": null}, "promotional_offer_name": {"type": "INT64", "index": 23, "name": "promotional_offer_name", "comment": null}, "state": {"type": "STRING", "index": 24, "name": "state", "comment": null}, "active_pay_as_you_go_introductory_offer_subscriptions": {"type": "INT64", "index": 25, "name": "active_pay_as_you_go_introductory_offer_subscriptions", "comment": null}, "subscription_group_id": {"type": "INT64", "index": 26, "name": "subscription_group_id", "comment": null}, "country": {"type": "STRING", "index": 27, "name": "country", "comment": null}, "active_free_trial_introductory_offer_subscriptions": {"type": "INT64", "index": 28, "name": "active_free_trial_introductory_offer_subscriptions", "comment": null}, "promotional_offer_id": {"type": "INT64", "index": 29, "name": "promotional_offer_id", "comment": null}, "app_apple_id": {"type": "INT64", "index": 30, "name": "app_apple_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 31, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2678.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 10.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_integration_tests.sales_subscription_summary"}, "seed.apple_store_source.apple_store_country_codes": {"metadata": {"type": "table", "schema": "dbt_apple_store_integration_tests_apple_store_source", "name": "apple_store_country_codes", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"country_name": {"type": "STRING", "index": 1, "name": "country_name", "comment": null}, "alternative_country_name": {"type": "STRING", "index": 2, "name": "alternative_country_name", "comment": null}, "country_code_numeric": {"type": "INT64", "index": 3, "name": "country_code_numeric", "comment": null}, "country_code_alpha_2": {"type": "STRING", "index": 4, "name": "country_code_alpha_2", "comment": null}, "country_code_alpha_3": {"type": "STRING", "index": 5, "name": "country_code_alpha_3", "comment": null}, "region": {"type": "STRING", "index": 6, "name": "region", "comment": null}, "region_code": {"type": "INT64", "index": 7, "name": "region_code", "comment": null}, "sub_region": {"type": "STRING", "index": 8, "name": "sub_region", "comment": null}, "sub_region_code": {"type": "INT64", "index": 9, "name": "sub_region_code", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18745.0, "include": 1.0, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 249.0, "include": 1.0, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.apple_store_source.apple_store_country_codes"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index ed5117a..2143596 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-05-19T18:11:31.540954Z", "invocation_id": "6fb5cc63-8a97-47af-b1a5-83f20142fb33", "env": {}, "project_id": "694016150451044e4ea5e317a0bdf1bd", "user_id": "535a716f-60c0-47b9-9763-5e1b450166b6", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.apple_store_integration_tests.sales_account": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "sales_account"], "unique_id": "seed.apple_store_integration_tests.sales_account", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "sales_account.csv", "original_file_path": "seeds/sales_account.csv", "name": "sales_account", "alias": "sales_account", "checksum": {"name": "sha256", "checksum": "b0beb05040309720fd22ec4cd11c9b4abd9914e48f47b8f6b0cc3e08a57c8a85"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.3743622, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_account`"}, "seed.apple_store_integration_tests.sales_subscription_summary": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "sales_subscription_summary"], "unique_id": "seed.apple_store_integration_tests.sales_subscription_summary", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "sales_subscription_summary.csv", "original_file_path": "seeds/sales_subscription_summary.csv", "name": "sales_subscription_summary", "alias": "sales_subscription_summary", "checksum": {"name": "sha256", "checksum": "feb7b6555873c3c5d12637db6a08f11d103bb7c5875ae4ac18dd2a06f02553a1"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.386938, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_subscription_summary`"}, "seed.apple_store_integration_tests.downloads_source_type_device": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "downloads_source_type_device"], "unique_id": "seed.apple_store_integration_tests.downloads_source_type_device", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "downloads_source_type_device.csv", "original_file_path": "seeds/downloads_source_type_device.csv", "name": "downloads_source_type_device", "alias": "downloads_source_type_device", "checksum": {"name": "sha256", "checksum": "a3cda4bfc0ad2bfffd8a7b9f80b1dac0b86e1547ecdc0199ca229890f46a3d37"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.389121, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_source_type_device`"}, "seed.apple_store_integration_tests.crashes_platform_version": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "crashes_platform_version"], "unique_id": "seed.apple_store_integration_tests.crashes_platform_version", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "crashes_platform_version.csv", "original_file_path": "seeds/crashes_platform_version.csv", "name": "crashes_platform_version", "alias": "crashes_platform_version", "checksum": {"name": "sha256", "checksum": "c31e1b3459a5eff06b81f214930f90d70559a65cae557dac7a967cc9dfe274b9"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.391077, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`crashes_platform_version`"}, "seed.apple_store_integration_tests.usage_app_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_app_version_source_type"], "unique_id": "seed.apple_store_integration_tests.usage_app_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_app_version_source_type.csv", "original_file_path": "seeds/usage_app_version_source_type.csv", "name": "usage_app_version_source_type", "alias": "usage_app_version_source_type", "checksum": {"name": "sha256", "checksum": "890b8d476624630b14e7eda1f907df13dc9fa1a80b21326752552021c8ace4e6"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.392941, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_app_version_source_type`"}, "seed.apple_store_integration_tests.sales_subscription_events": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "sales_subscription_events"], "unique_id": "seed.apple_store_integration_tests.sales_subscription_events", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "sales_subscription_events.csv", "original_file_path": "seeds/sales_subscription_events.csv", "name": "sales_subscription_events", "alias": "sales_subscription_events", "checksum": {"name": "sha256", "checksum": "04c613e3c10db418886b7e313db88a9e2a074e2ea106de540fbc59d3a2d381de"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.394736, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_subscription_events`"}, "seed.apple_store_integration_tests.crashes_app_version": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "crashes_app_version"], "unique_id": "seed.apple_store_integration_tests.crashes_app_version", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "crashes_app_version.csv", "original_file_path": "seeds/crashes_app_version.csv", "name": "crashes_app_version", "alias": "crashes_app_version", "checksum": {"name": "sha256", "checksum": "e527991e8d57f4cc314d8fecfd05fa7534a490661962306f001c0b40631bac43"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.396687, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`crashes_app_version`"}, "seed.apple_store_integration_tests.downloads_territory_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "downloads_territory_source_type"], "unique_id": "seed.apple_store_integration_tests.downloads_territory_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "downloads_territory_source_type.csv", "original_file_path": "seeds/downloads_territory_source_type.csv", "name": "downloads_territory_source_type", "alias": "downloads_territory_source_type", "checksum": {"name": "sha256", "checksum": "7a404692d812424fb2dae99130aa4bca94ebd6c6acb8bfaef51698896fbc4de3"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.3984509, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_territory_source_type`"}, "seed.apple_store_integration_tests.usage_territory_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_territory_source_type"], "unique_id": "seed.apple_store_integration_tests.usage_territory_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_territory_source_type.csv", "original_file_path": "seeds/usage_territory_source_type.csv", "name": "usage_territory_source_type", "alias": "usage_territory_source_type", "checksum": {"name": "sha256", "checksum": "6da52999e8d07014078385028042c5d7983c5a53e3b03d3c36a215a3a770fb60"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.400213, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_territory_source_type`"}, "seed.apple_store_integration_tests.usage_source_type_device": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_source_type_device"], "unique_id": "seed.apple_store_integration_tests.usage_source_type_device", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_source_type_device.csv", "original_file_path": "seeds/usage_source_type_device.csv", "name": "usage_source_type_device", "alias": "usage_source_type_device", "checksum": {"name": "sha256", "checksum": "92ee795bbf366b5b15a07481f61e5e9857d5e37596985d5e9f693555f23edf79"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.401969, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_source_type_device`"}, "seed.apple_store_integration_tests.app_store_territory_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app_store_territory_source_type"], "unique_id": "seed.apple_store_integration_tests.app_store_territory_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app_store_territory_source_type.csv", "original_file_path": "seeds/app_store_territory_source_type.csv", "name": "app_store_territory_source_type", "alias": "app_store_territory_source_type", "checksum": {"name": "sha256", "checksum": "6278fc0117fee62477e9b87cfb6d6b4806375ed1abce39f699c32079c2bb912d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.4039261, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_territory_source_type`"}, "seed.apple_store_integration_tests.app_store_platform_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app_store_platform_version_source_type"], "unique_id": "seed.apple_store_integration_tests.app_store_platform_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app_store_platform_version_source_type.csv", "original_file_path": "seeds/app_store_platform_version_source_type.csv", "name": "app_store_platform_version_source_type", "alias": "app_store_platform_version_source_type", "checksum": {"name": "sha256", "checksum": "91387e5b27f61e4b3d96153027f655b1827a9fa00273395a5d1b3b3ce0696d82"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.405686, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_platform_version_source_type`"}, "seed.apple_store_integration_tests.usage_platform_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_platform_version_source_type"], "unique_id": "seed.apple_store_integration_tests.usage_platform_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_platform_version_source_type.csv", "original_file_path": "seeds/usage_platform_version_source_type.csv", "name": "usage_platform_version_source_type", "alias": "usage_platform_version_source_type", "checksum": {"name": "sha256", "checksum": "075debe615e09ad5eb25f920aca3c9e4a5a24d9787ad444dde0adac6a0c1eab4"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.407445, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_platform_version_source_type`"}, "seed.apple_store_integration_tests.downloads_platform_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "downloads_platform_version_source_type"], "unique_id": "seed.apple_store_integration_tests.downloads_platform_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "downloads_platform_version_source_type.csv", "original_file_path": "seeds/downloads_platform_version_source_type.csv", "name": "downloads_platform_version_source_type", "alias": "downloads_platform_version_source_type", "checksum": {"name": "sha256", "checksum": "134152125ea3264f55419ce6985f5ca1c42c1aefe2c2d33cc6e9e1436a1bdf09"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.409208, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_platform_version_source_type`"}, "seed.apple_store_integration_tests.app": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app"], "unique_id": "seed.apple_store_integration_tests.app", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app.csv", "original_file_path": "seeds/app.csv", "name": "app", "alias": "app", "checksum": {"name": "sha256", "checksum": "7c127fe1a3eef27fc38a41632059ef1ca791b3d48469a25531c7f094586681c5"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.4109702, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app`"}, "seed.apple_store_integration_tests.app_store_source_type_device": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app_store_source_type_device"], "unique_id": "seed.apple_store_integration_tests.app_store_source_type_device", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app_store_source_type_device.csv", "original_file_path": "seeds/app_store_source_type_device.csv", "name": "app_store_source_type_device", "alias": "app_store_source_type_device", "checksum": {"name": "sha256", "checksum": "8b3ebc33706e64f998b00068ca21f0312cb19b0fb09ee88baa164b747853daf7"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1652983818.412777, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_source_type_device`"}, "model.apple_store_source.stg_apple_store__crashes_app_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__crashes_app_version_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_apple_store__crashes_app_version_tmp')),\n staging_columns=get_crashes_app_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n app_version,\n crashes\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_crashes_app_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version_tmp", "model.apple_store_source.stg_apple_store__crashes_app_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__crashes_app_version"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__crashes_app_version.sql", "original_file_path": "models/stg_apple_store__crashes_app_version.sql", "name": "stg_apple_store__crashes_app_version", "alias": "stg_apple_store__crashes_app_version", "checksum": {"name": "sha256", "checksum": "d431a75de72055a9140666cffb9aec924ef6ea62c5654c462ae400b94df92dc0"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version_tmp"], ["stg_apple_store__crashes_app_version_tmp"]], "sources": [], "description": "Daily crashes by app version and device.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__crashes_app_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.025815, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n string\n) as \n \n app_version\n \n , \n cast(null as \n int64\n) as \n \n crashes\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n app_version,\n crashes\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`"}, "model.apple_store_source.stg_apple_store__sales_account": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__sales_account_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_apple_store__sales_account_tmp')),\n staging_columns=get_sales_account_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as account_id,\n name as account_name\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_sales_account_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__sales_account_tmp", "model.apple_store_source.stg_apple_store__sales_account_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__sales_account"], "unique_id": "model.apple_store_source.stg_apple_store__sales_account", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__sales_account.sql", "original_file_path": "models/stg_apple_store__sales_account.sql", "name": "stg_apple_store__sales_account", "alias": "stg_apple_store__sales_account", "checksum": {"name": "sha256", "checksum": "95203af9f7e8ee442491847b595dafe9413934ebd594f25f5b3e62329513af80"}, "tags": [], "refs": [["stg_apple_store__sales_account_tmp"], ["stg_apple_store__sales_account_tmp"]], "sources": [], "description": "Table containing sales account data.", "columns": {"account_id": {"name": "account_id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Sales Account Name associated with the Sales Account ID, app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__sales_account.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.036129, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n id\n \n , \n cast(null as \n string\n) as \n \n name\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as account_id,\n name as account_name\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`"}, "model.apple_store_source.stg_apple_store__usage_app_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_app_version_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_apple_store__usage_app_version_tmp')),\n staging_columns=get_usage_app_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n app_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_app_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_app_version_tmp", "model.apple_store_source.stg_apple_store__usage_app_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_app_version"], "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_app_version.sql", "original_file_path": "models/stg_apple_store__usage_app_version.sql", "name": "stg_apple_store__usage_app_version", "alias": "stg_apple_store__usage_app_version", "checksum": {"name": "sha256", "checksum": "bba425b14bf4248e7091d6d867e395c93e5e7c500a11233a4ea2487b00baaa9c"}, "tags": [], "refs": [["stg_apple_store__usage_app_version_tmp"], ["stg_apple_store__usage_app_version_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by app version and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_app_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.0452962, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n string\n) as \n \n app_version\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n app_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version`"}, "model.apple_store_source.stg_apple_store__app_store_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_store_platform_version_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_apple_store__app_store_platform_version_tmp')),\n staging_columns=get_app_store_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_store_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_platform_version_tmp", "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app_store_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app_store_platform_version.sql", "original_file_path": "models/stg_apple_store__app_store_platform_version.sql", "name": "stg_apple_store__app_store_platform_version", "alias": "stg_apple_store__app_store_platform_version", "checksum": {"name": "sha256", "checksum": "0187daf96531ccaf71383dcffcbf1aa4065f93de4406c0423bde44b0fa07be98"}, "tags": [], "refs": [["stg_apple_store__app_store_platform_version_tmp"], ["stg_apple_store__app_store_platform_version_tmp"]], "sources": [], "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by platform version and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app_store_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.020908, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n impressions\n \n , \n cast(null as \n int64\n) as \n \n impressions_unique_device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n page_views\n \n , \n cast(null as \n int64\n) as \n \n page_views_unique_device\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version`"}, "model.apple_store_source.stg_apple_store__app_store_territory": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_store_territory_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_apple_store__app_store_territory_tmp')),\n staging_columns=get_app_store_territory_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_store_territory_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_territory_tmp", "model.apple_store_source.stg_apple_store__app_store_territory_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app_store_territory"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app_store_territory.sql", "original_file_path": "models/stg_apple_store__app_store_territory.sql", "name": "stg_apple_store__app_store_territory", "alias": "stg_apple_store__app_store_territory", "checksum": {"name": "sha256", "checksum": "2a64b9a651e216c1b3f3d662470f7985ea934eeba075b13cdbbefc9cf69803bb"}, "tags": [], "refs": [["stg_apple_store__app_store_territory_tmp"], ["stg_apple_store__app_store_territory_tmp"]], "sources": [], "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by territory and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app_store_territory.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.023884, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n impressions\n \n , \n cast(null as \n int64\n) as \n \n impressions_unique_device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n page_views\n \n , \n cast(null as \n int64\n) as \n \n page_views_unique_device\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n string\n) as \n \n territory\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory`"}, "model.apple_store_source.stg_apple_store__app_store_device": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_store_device_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_apple_store__app_store_device_tmp')),\n staging_columns=get_app_store_device_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_store_device_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device_tmp", "model.apple_store_source.stg_apple_store__app_store_device_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app_store_device"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app_store_device.sql", "original_file_path": "models/stg_apple_store__app_store_device.sql", "name": "stg_apple_store__app_store_device", "alias": "stg_apple_store__app_store_device", "checksum": {"name": "sha256", "checksum": "43510ee905ae07e6f74d111e01ec6d7ee059235fa565f9ff8f675ffd86bcf34e"}, "tags": [], "refs": [["stg_apple_store__app_store_device_tmp"], ["stg_apple_store__app_store_device_tmp"]], "sources": [], "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by device and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app_store_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.017954, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n impressions\n \n , \n cast(null as \n int64\n) as \n \n impressions_unique_device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n page_views\n \n , \n cast(null as \n int64\n) as \n \n page_views_unique_device\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`"}, "model.apple_store_source.stg_apple_store__usage_device": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_device_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_apple_store__usage_device_tmp')),\n staging_columns=get_usage_device_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_device_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device_tmp", "model.apple_store_source.stg_apple_store__usage_device_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_device"], "unique_id": "model.apple_store_source.stg_apple_store__usage_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_device.sql", "original_file_path": "models/stg_apple_store__usage_device.sql", "name": "stg_apple_store__usage_device", "alias": "stg_apple_store__usage_device", "checksum": {"name": "sha256", "checksum": "d578a6e605f1fff816fc9265a4e1d08e6beeb48f59891fc01f9c72da5bb8066c"}, "tags": [], "refs": [["stg_apple_store__usage_device_tmp"], ["stg_apple_store__usage_device_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by device and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.048311, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`"}, "model.apple_store_source.stg_apple_store__downloads_device": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__downloads_device_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_apple_store__downloads_device_tmp')),\n staging_columns=get_downloads_device_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_downloads_device_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device_tmp", "model.apple_store_source.stg_apple_store__downloads_device_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__downloads_device"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__downloads_device.sql", "original_file_path": "models/stg_apple_store__downloads_device.sql", "name": "stg_apple_store__downloads_device", "alias": "stg_apple_store__downloads_device", "checksum": {"name": "sha256", "checksum": "2a7cb1eaf3f13ccc87c890d7d7339358344d0b9810325ea8da8302ceefd46ceb"}, "tags": [], "refs": [["stg_apple_store__downloads_device_tmp"], ["stg_apple_store__downloads_device_tmp"]], "sources": [], "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by device and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__downloads_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.030103, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n first_time_downloads\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n redownloads\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n int64\n) as \n \n total_downloads\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`"}, "model.apple_store_source.stg_apple_store__usage_territory": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_territory_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_apple_store__usage_territory_tmp')),\n staging_columns=get_usage_territory_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_territory_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_territory_tmp", "model.apple_store_source.stg_apple_store__usage_territory_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_territory"], "unique_id": "model.apple_store_source.stg_apple_store__usage_territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_territory.sql", "original_file_path": "models/stg_apple_store__usage_territory.sql", "name": "stg_apple_store__usage_territory", "alias": "stg_apple_store__usage_territory", "checksum": {"name": "sha256", "checksum": "c1175004d35ac5801311c7e1931b50f086fbdf12cb7e043c4db3b2936ff48665"}, "tags": [], "refs": [["stg_apple_store__usage_territory_tmp"], ["stg_apple_store__usage_territory_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by territory and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_territory.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.054236, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n string\n) as \n \n territory\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory`"}, "model.apple_store_source.stg_apple_store__crashes_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__crashes_platform_version_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_apple_store__crashes_platform_version_tmp')),\n staging_columns=get_crashes_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n platform_version,\n crashes\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_crashes_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_platform_version_tmp", "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__crashes_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__crashes_platform_version.sql", "original_file_path": "models/stg_apple_store__crashes_platform_version.sql", "name": "stg_apple_store__crashes_platform_version", "alias": "stg_apple_store__crashes_platform_version", "checksum": {"name": "sha256", "checksum": "a867908488889f253a56fe1e265a17746151a0ac13068496a856e8136cd052ab"}, "tags": [], "refs": [["stg_apple_store__crashes_platform_version_tmp"], ["stg_apple_store__crashes_platform_version_tmp"]], "sources": [], "description": "Daily crashes by platform version and device.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__crashes_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.027637, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n int64\n) as \n \n crashes\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n platform_version,\n crashes\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`"}, "model.apple_store_source.stg_apple_store__app": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_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_apple_store__app_tmp')),\n staging_columns=get_app_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as app_id,\n name as app_name,\n is_enabled\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_tmp", "model.apple_store_source.stg_apple_store__app_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app"], "unique_id": "model.apple_store_source.stg_apple_store__app", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app.sql", "original_file_path": "models/stg_apple_store__app.sql", "name": "stg_apple_store__app", "alias": "stg_apple_store__app", "checksum": {"name": "sha256", "checksum": "32cdc58eecfca0fcb4a7caa9490ad0cd220c65f7081a8b3c29e22797c9e5b56d"}, "tags": [], "refs": [["stg_apple_store__app_tmp"], ["stg_apple_store__app_tmp"]], "sources": [], "description": "Table containing data about your application(s)", "columns": {"app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicator for whether application is enabled or not.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.015309, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_opt_in_rate\n \n , \n cast(null as \n string\n) as \n \n asset_token\n \n , \n cast(null as \n string\n) as \n \n icon_url\n \n , \n cast(null as \n int64\n) as \n \n id\n \n , \n cast(null as boolean) as \n \n ios\n \n , \n cast(null as boolean) as \n \n is_bundle\n \n , \n cast(null as boolean) as \n \n is_enabled\n \n , \n cast(null as \n string\n) as \n \n name\n \n , \n cast(null as \n string\n) as \n \n pre_order_info\n \n , \n cast(null as boolean) as \n \n tvos\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as app_id,\n name as app_name,\n is_enabled\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`"}, "model.apple_store_source.stg_apple_store__downloads_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__downloads_platform_version_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_apple_store__downloads_platform_version_tmp')),\n staging_columns=get_downloads_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_downloads_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_platform_version_tmp", "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__downloads_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__downloads_platform_version.sql", "original_file_path": "models/stg_apple_store__downloads_platform_version.sql", "name": "stg_apple_store__downloads_platform_version", "alias": "stg_apple_store__downloads_platform_version", "checksum": {"name": "sha256", "checksum": "b0304bbcf8a90ccc9f5e1642076ae836843b26a841ae67410e53ed1ede5add85"}, "tags": [], "refs": [["stg_apple_store__downloads_platform_version_tmp"], ["stg_apple_store__downloads_platform_version_tmp"]], "sources": [], "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__downloads_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.0325608, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n first_time_downloads\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n , \n cast(null as \n int64\n) as \n \n redownloads\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n int64\n) as \n \n total_downloads\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version`"}, "model.apple_store_source.stg_apple_store__usage_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_platform_version_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_apple_store__usage_platform_version_tmp')),\n staging_columns=get_usage_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_platform_version_tmp", "model.apple_store_source.stg_apple_store__usage_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_platform_version.sql", "original_file_path": "models/stg_apple_store__usage_platform_version.sql", "name": "stg_apple_store__usage_platform_version", "alias": "stg_apple_store__usage_platform_version", "checksum": {"name": "sha256", "checksum": "282f6c6ea0ab72137b267f801010d1ecaeff74dc3a2beeca065fa1d096b287be"}, "tags": [], "refs": [["stg_apple_store__usage_platform_version_tmp"], ["stg_apple_store__usage_platform_version_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by platform version and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.051332, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version`"}, "model.apple_store_source.stg_apple_store__downloads_territory": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__downloads_territory_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_apple_store__downloads_territory_tmp')),\n staging_columns=get_downloads_territory_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_downloads_territory_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_territory_tmp", "model.apple_store_source.stg_apple_store__downloads_territory_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__downloads_territory"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__downloads_territory.sql", "original_file_path": "models/stg_apple_store__downloads_territory.sql", "name": "stg_apple_store__downloads_territory", "alias": "stg_apple_store__downloads_territory", "checksum": {"name": "sha256", "checksum": "5264a06209bff16cab3d897ced9a7d7d9d9b60720648793edc8f822a1d1c3042"}, "tags": [], "refs": [["stg_apple_store__downloads_territory_tmp"], ["stg_apple_store__downloads_territory_tmp"]], "sources": [], "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by territory and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__downloads_territory.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1652983819.035018, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory_tmp`\n\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n first_time_downloads\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n redownloads\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n string\n) as \n \n territory\n \n , \n cast(null as \n int64\n) as \n \n total_downloads\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory`"}, "model.apple_store_source.stg_apple_store__app_tmp": {"raw_sql": "select * from {{ var('app') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.app"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_tmp.sql", "name": "stg_apple_store__app_tmp", "alias": "stg_apple_store__app_tmp", "checksum": {"name": "sha256", "checksum": "18fbc25886de534d2308dfcf1a8495e2f750bbd4a39827e3026ed302d7e6fd64"}, "tags": [], "refs": [["app"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.662061, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`app`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_tmp`"}, "model.apple_store_source.stg_apple_store__usage_platform_version_tmp": {"raw_sql": "select * from {{ var('usage_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.usage_platform_version_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_platform_version_tmp.sql", "name": "stg_apple_store__usage_platform_version_tmp", "alias": "stg_apple_store__usage_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "5fd0e49f0fd85ac542b8df1b738436bf68f878d7309c5a5ceadd59da0c6de244"}, "tags": [], "refs": [["usage_platform_version_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.6743522, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_platform_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__app_store_territory_tmp": {"raw_sql": "select * from {{ var('app_store_territory') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.app_store_territory_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_store_territory_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_store_territory_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_store_territory_tmp.sql", "name": "stg_apple_store__app_store_territory_tmp", "alias": "stg_apple_store__app_store_territory_tmp", "checksum": {"name": "sha256", "checksum": "104a7ddf41158ad9df36418b4c04347b4ff9129408f97d2ddb197cc95ea5e796"}, "tags": [], "refs": [["app_store_territory_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_store_territory_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.679241, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_territory_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory_tmp`"}, "model.apple_store_source.stg_apple_store__downloads_territory_tmp": {"raw_sql": "select * from {{ var('downloads_territory') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.downloads_territory_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__downloads_territory_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__downloads_territory_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__downloads_territory_tmp.sql", "name": "stg_apple_store__downloads_territory_tmp", "alias": "stg_apple_store__downloads_territory_tmp", "checksum": {"name": "sha256", "checksum": "0f5c83e6d679908973e4073967fb46ffb39655b4919b4d612dcf41b46f086162"}, "tags": [], "refs": [["downloads_territory_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__downloads_territory_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.684394, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_territory_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory_tmp`"}, "model.apple_store_source.stg_apple_store__sales_account_tmp": {"raw_sql": "select * from {{ var('sales_account') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.sales_account"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__sales_account_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__sales_account_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__sales_account_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__sales_account_tmp.sql", "name": "stg_apple_store__sales_account_tmp", "alias": "stg_apple_store__sales_account_tmp", "checksum": {"name": "sha256", "checksum": "cdd78ef4adbd8d1850f61e16aa3d9b71fbfc06f73e0648d6af42213afc5a6640"}, "tags": [], "refs": [["sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__sales_account_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.689449, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_account`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account_tmp`"}, "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp": {"raw_sql": "select * from {{ var('downloads_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.downloads_platform_version_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__downloads_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__downloads_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__downloads_platform_version_tmp.sql", "name": "stg_apple_store__downloads_platform_version_tmp", "alias": "stg_apple_store__downloads_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "549ef10a4318974e5e510c727d9425433e237290633451911108fbc03873f1de"}, "tags": [], "refs": [["downloads_platform_version_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__downloads_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.694023, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_platform_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__usage_territory_tmp": {"raw_sql": "select * from {{ var('usage_territory') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.usage_territory_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_territory_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_territory_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_territory_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_territory_tmp.sql", "name": "stg_apple_store__usage_territory_tmp", "alias": "stg_apple_store__usage_territory_tmp", "checksum": {"name": "sha256", "checksum": "82c6696835b4302946d6ac57b89f7016d4a3ee7e21e1b12f9b636cd503964157"}, "tags": [], "refs": [["usage_territory_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_territory_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.698164, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_territory_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory_tmp`"}, "model.apple_store_source.stg_apple_store__crashes_app_version_tmp": {"raw_sql": "select * from {{ var('crashes_app_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__crashes_app_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__crashes_app_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__crashes_app_version_tmp.sql", "name": "stg_apple_store__crashes_app_version_tmp", "alias": "stg_apple_store__crashes_app_version_tmp", "checksum": {"name": "sha256", "checksum": "2f21531a09cb8c07b5e56e021cb6bffcb64ca33863f35131e777819198ab44ad"}, "tags": [], "refs": [["crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__crashes_app_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.702945, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`crashes_app_version`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version_tmp`"}, "model.apple_store_source.stg_apple_store__downloads_device_tmp": {"raw_sql": "select * from {{ var('downloads_device') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.downloads_source_type_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__downloads_device_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_device_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__downloads_device_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__downloads_device_tmp.sql", "name": "stg_apple_store__downloads_device_tmp", "alias": "stg_apple_store__downloads_device_tmp", "checksum": {"name": "sha256", "checksum": "6751ff4461803b97a17ea6b665e611a99c07c5509152198326545dfe882c43e7"}, "tags": [], "refs": [["downloads_source_type_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__downloads_device_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.707001, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_source_type_device`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device_tmp`"}, "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp": {"raw_sql": "select * from {{ var('crashes_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.crashes_platform_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__crashes_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__crashes_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__crashes_platform_version_tmp.sql", "name": "stg_apple_store__crashes_platform_version_tmp", "alias": "stg_apple_store__crashes_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "5d0debb718a1c1ae65684eff5c6da13a7ad6ac09748cd41f58e1a8f1a53217e7"}, "tags": [], "refs": [["crashes_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__crashes_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.716331, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`crashes_platform_version`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__app_store_device_tmp": {"raw_sql": "select * from {{ var('app_store_device') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.app_store_source_type_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_store_device_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_device_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_store_device_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_store_device_tmp.sql", "name": "stg_apple_store__app_store_device_tmp", "alias": "stg_apple_store__app_store_device_tmp", "checksum": {"name": "sha256", "checksum": "a0fea683d944fd933f317ef76b149992be2c4cd3625826dc4d54e32892c5dad1"}, "tags": [], "refs": [["app_store_source_type_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_store_device_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.720316, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_source_type_device`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device_tmp`"}, "model.apple_store_source.stg_apple_store__usage_app_version_tmp": {"raw_sql": "select * from {{ var('usage_app_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.usage_app_version_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_app_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_app_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_app_version_tmp.sql", "name": "stg_apple_store__usage_app_version_tmp", "alias": "stg_apple_store__usage_app_version_tmp", "checksum": {"name": "sha256", "checksum": "b8a015565f3f98fcee8187bfd19eb9faf1c0e693354187139984b38e921a644f"}, "tags": [], "refs": [["usage_app_version_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_app_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.724354, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_app_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version_tmp`"}, "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp": {"raw_sql": "select * from {{ var('app_store_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.app_store_platform_version_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_store_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_store_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_store_platform_version_tmp.sql", "name": "stg_apple_store__app_store_platform_version_tmp", "alias": "stg_apple_store__app_store_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "9c1376b9c674cfb05bb54515451c7489549115005afa0c21364a520114ec1588"}, "tags": [], "refs": [["app_store_platform_version_source_type"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_store_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.7292569, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_platform_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__usage_device_tmp": {"raw_sql": "select * from {{ var('usage_device') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.apple_store_integration_tests.usage_source_type_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_device_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_device_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_device_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_device_tmp.sql", "name": "stg_apple_store__usage_device_tmp", "alias": "stg_apple_store__usage_device_tmp", "checksum": {"name": "sha256", "checksum": "fec62eb71eb004f94d022fc3d0d3a3ffeb6d02bbf11589cc178a186a51f3c537"}, "tags": [], "refs": [["usage_source_type_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_device_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1652983818.733253, "compiled_sql": "select * from `dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_source_type_device`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device_tmp`"}, "seed.apple_store_source.apple_store_country_codes": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "apple_store_country_codes"], "unique_id": "seed.apple_store_source.apple_store_country_codes", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "apple_store_country_codes.csv", "original_file_path": "seeds/apple_store_country_codes.csv", "name": "apple_store_country_codes", "alias": "apple_store_country_codes", "checksum": {"name": "sha256", "checksum": "8060985550563a0c6038205790d5c1bdba362d13e0cfed88fb781419e38be20c"}, "tags": [], "refs": [], "sources": [], "description": "ISO-3166 country mapping table", "columns": {"country_name": {"name": "country_name", "description": "The ISO-3166 English country name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alternative_country_name": {"name": "alternative_country_name", "description": "Due to differences in the official ISO country names and Apple's naming convention, we've added an alternative territory name that will allow us to join reports and infer ISO fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code_numeric": {"name": "country_code_numeric", "description": "The 3 digit ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code_alpha_2": {"name": "country_code_alpha_2", "description": "The 2 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code_alpha3": {"name": "country_code_alpha3", "description": "The 3 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region": {"name": "region", "description": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region_code": {"name": "region_code", "description": "The UN Statistics region numerical code assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region": {"name": "sub_region", "description": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region_code": {"name": "sub_region_code", "description": "The UN Statistics sub-region numerical code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "apple_store_source"}, "created_at": 1652983819.139776, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`apple_store_country_codes`"}, "model.apple_store.apple_store__source_type_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_source_type as (\n\n select *\n from {{ ref('int_apple_store__app_store_source_type') }}\n),\n\ndownloads_source_type as (\n\n select *\n from {{ ref('int_apple_store__downloads_source_type') }}\n),\n\nusage_source_type as (\n\n select *\n from {{ ref('int_apple_store__usage_source_type') }}\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type\n from app_store_source_type\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n coalesce(app_store_source_type.impressions, 0) as impressions,\n coalesce(app_store_source_type.page_views, 0) as page_views,\n coalesce(downloads_source_type.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_source_type.redownloads, 0) as redownloads,\n coalesce(downloads_source_type.total_downloads, 0) as total_downloads,\n coalesce(usage_source_type.active_devices, 0) as active_devices,\n coalesce(usage_source_type.deletions, 0) as deletions,\n coalesce(usage_source_type.installations, 0) as installations,\n coalesce(usage_source_type.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_source_type\n on reporting_grain.date_day = app_store_source_type.date_day\n and reporting_grain.app_id = app_store_source_type.app_id \n and reporting_grain.source_type = app_store_source_type.source_type\n left join downloads_source_type\n on reporting_grain.date_day = downloads_source_type.date_day\n and reporting_grain.app_id = downloads_source_type.app_id \n and reporting_grain.source_type = downloads_source_type.source_type\n left join usage_source_type\n on reporting_grain.date_day = usage_source_type.date_day\n and reporting_grain.app_id = usage_source_type.app_id \n and reporting_grain.source_type = usage_source_type.source_type\n)\n\nselect * from joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store.int_apple_store__app_store_source_type", "model.apple_store.int_apple_store__downloads_source_type", "model.apple_store.int_apple_store__usage_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__source_type_report"], "unique_id": "model.apple_store.apple_store__source_type_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__source_type_report.sql", "original_file_path": "models/apple_store__source_type_report.sql", "name": "apple_store__source_type_report", "alias": "apple_store__source_type_report", "checksum": {"name": "sha256", "checksum": "2856773a6b52742252f6520d6b295c8a252541551b076b8c8bbe66199ac4a45c"}, "tags": [], "refs": [["stg_apple_store__app"], ["int_apple_store__app_store_source_type"], ["int_apple_store__downloads_source_type"], ["int_apple_store__usage_source_type"]], "sources": [], "description": "Each record represents daily metrics by app_id and source_type", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__source_type_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1652983819.162845, "compiled_sql": "with __dbt__cte__int_apple_store__app_store_source_type as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2,3\n\n)\n\nselect * from aggregated\n), __dbt__cte__int_apple_store__downloads_source_type as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2,3\n)\n\nselect * from aggregated\n), __dbt__cte__int_apple_store__usage_source_type as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2,3\n)\n\nselect * from aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_source_type as (\n\n select *\n from __dbt__cte__int_apple_store__app_store_source_type\n),\n\ndownloads_source_type as (\n\n select *\n from __dbt__cte__int_apple_store__downloads_source_type\n),\n\nusage_source_type as (\n\n select *\n from __dbt__cte__int_apple_store__usage_source_type\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type\n from app_store_source_type\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n coalesce(app_store_source_type.impressions, 0) as impressions,\n coalesce(app_store_source_type.page_views, 0) as page_views,\n coalesce(downloads_source_type.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_source_type.redownloads, 0) as redownloads,\n coalesce(downloads_source_type.total_downloads, 0) as total_downloads,\n coalesce(usage_source_type.active_devices, 0) as active_devices,\n coalesce(usage_source_type.deletions, 0) as deletions,\n coalesce(usage_source_type.installations, 0) as installations,\n coalesce(usage_source_type.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_source_type\n on reporting_grain.date_day = app_store_source_type.date_day\n and reporting_grain.app_id = app_store_source_type.app_id \n and reporting_grain.source_type = app_store_source_type.source_type\n left join downloads_source_type\n on reporting_grain.date_day = downloads_source_type.date_day\n and reporting_grain.app_id = downloads_source_type.app_id \n and reporting_grain.source_type = downloads_source_type.source_type\n left join usage_source_type\n on reporting_grain.date_day = usage_source_type.date_day\n and reporting_grain.app_id = usage_source_type.app_id \n and reporting_grain.source_type = usage_source_type.source_type\n)\n\nselect * from joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__app_store_source_type", "sql": " __dbt__cte__int_apple_store__app_store_source_type as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2,3\n\n)\n\nselect * from aggregated\n)"}, {"id": "model.apple_store.int_apple_store__downloads_source_type", "sql": " __dbt__cte__int_apple_store__downloads_source_type as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2,3\n)\n\nselect * from aggregated\n)"}, {"id": "model.apple_store.int_apple_store__usage_source_type", "sql": " __dbt__cte__int_apple_store__usage_source_type as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2,3\n)\n\nselect * from aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__source_type_report`"}, "model.apple_store.apple_store__platform_version_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_platform_version as (\n \n select *\n from {{ var('app_store_platform_version') }}\n),\n\ncrashes_platform_version as (\n \n select *\n from {{ ref('int_apple_store__platform_version') }}\n),\n\ndownloads_platform_version as (\n\n select *\n from {{ var('downloads_platform_version') }}\n),\n\nusage_platform_version as (\n\n select *\n from {{ var('usage_platform_version') }}\n),\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n platform_version\n from app_store_platform_version\n union all\n select \n date_day,\n app_id,\n source_type,\n platform_version\n from crashes_platform_version\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.platform_version,\n coalesce(app_store_platform_version.impressions, 0) as impressions,\n coalesce(app_store_platform_version.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_platform_version.page_views, 0) as page_views,\n coalesce(app_store_platform_version.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_platform_version.crashes, 0) as crashes,\n coalesce(downloads_platform_version.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_platform_version.redownloads, 0) as redownloads,\n coalesce(downloads_platform_version.total_downloads, 0) as total_downloads,\n coalesce(usage_platform_version.active_devices, 0) as active_devices,\n coalesce(usage_platform_version.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_platform_version.deletions, 0) as deletions,\n coalesce(usage_platform_version.installations, 0) as installations,\n coalesce(usage_platform_version.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_platform_version \n on reporting_grain.date_day = app_store_platform_version.date_day\n and reporting_grain.app_id = app_store_platform_version.app_id \n and reporting_grain.source_type = app_store_platform_version.source_type\n and reporting_grain.platform_version = app_store_platform_version.platform_version\n left join crashes_platform_version\n on reporting_grain.date_day = crashes_platform_version.date_day\n and reporting_grain.app_id = crashes_platform_version.app_id\n and reporting_grain.source_type = crashes_platform_version.source_type\n and reporting_grain.platform_version = crashes_platform_version.platform_version \n left join downloads_platform_version\n on reporting_grain.date_day = downloads_platform_version.date_day\n and reporting_grain.app_id = downloads_platform_version.app_id \n and reporting_grain.source_type = downloads_platform_version.source_type\n and reporting_grain.platform_version = downloads_platform_version.platform_version\n left join usage_platform_version\n on reporting_grain.date_day = usage_platform_version.date_day\n and reporting_grain.app_id = usage_platform_version.app_id \n and reporting_grain.source_type = usage_platform_version.source_type\n and reporting_grain.platform_version = usage_platform_version.platform_version\n)\n\nselect * from joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_platform_version", "model.apple_store.int_apple_store__platform_version", "model.apple_store_source.stg_apple_store__downloads_platform_version", "model.apple_store_source.stg_apple_store__usage_platform_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__platform_version_report"], "unique_id": "model.apple_store.apple_store__platform_version_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__platform_version_report.sql", "original_file_path": "models/apple_store__platform_version_report.sql", "name": "apple_store__platform_version_report", "alias": "apple_store__platform_version_report", "checksum": {"name": "sha256", "checksum": "5abe45234802d4f31c0f70de3c45b8f4500ad57da2a190a73d6d41e14aa31d5d"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__app_store_platform_version"], ["int_apple_store__platform_version"], ["stg_apple_store__downloads_platform_version"], ["stg_apple_store__usage_platform_version"]], "sources": [], "description": "Each record represents daily metrics for each by app_id, source_type and platform version", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__platform_version_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1652983819.172744, "compiled_sql": "with __dbt__cte__int_apple_store__platform_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_platform_version as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version`\n),\n\ncrashes_platform_version as (\n \n select *\n from __dbt__cte__int_apple_store__platform_version\n),\n\ndownloads_platform_version as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version`\n),\n\nusage_platform_version as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version`\n),\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n platform_version\n from app_store_platform_version\n union all\n select \n date_day,\n app_id,\n source_type,\n platform_version\n from crashes_platform_version\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.platform_version,\n coalesce(app_store_platform_version.impressions, 0) as impressions,\n coalesce(app_store_platform_version.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_platform_version.page_views, 0) as page_views,\n coalesce(app_store_platform_version.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_platform_version.crashes, 0) as crashes,\n coalesce(downloads_platform_version.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_platform_version.redownloads, 0) as redownloads,\n coalesce(downloads_platform_version.total_downloads, 0) as total_downloads,\n coalesce(usage_platform_version.active_devices, 0) as active_devices,\n coalesce(usage_platform_version.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_platform_version.deletions, 0) as deletions,\n coalesce(usage_platform_version.installations, 0) as installations,\n coalesce(usage_platform_version.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_platform_version \n on reporting_grain.date_day = app_store_platform_version.date_day\n and reporting_grain.app_id = app_store_platform_version.app_id \n and reporting_grain.source_type = app_store_platform_version.source_type\n and reporting_grain.platform_version = app_store_platform_version.platform_version\n left join crashes_platform_version\n on reporting_grain.date_day = crashes_platform_version.date_day\n and reporting_grain.app_id = crashes_platform_version.app_id\n and reporting_grain.source_type = crashes_platform_version.source_type\n and reporting_grain.platform_version = crashes_platform_version.platform_version \n left join downloads_platform_version\n on reporting_grain.date_day = downloads_platform_version.date_day\n and reporting_grain.app_id = downloads_platform_version.app_id \n and reporting_grain.source_type = downloads_platform_version.source_type\n and reporting_grain.platform_version = downloads_platform_version.platform_version\n left join usage_platform_version\n on reporting_grain.date_day = usage_platform_version.date_day\n and reporting_grain.app_id = usage_platform_version.app_id \n and reporting_grain.source_type = usage_platform_version.source_type\n and reporting_grain.platform_version = usage_platform_version.platform_version\n)\n\nselect * from joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__platform_version", "sql": " __dbt__cte__int_apple_store__platform_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__platform_version_report`"}, "model.apple_store.apple_store__territory_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_territory as (\n\n select *\n from {{ var('app_store_territory') }}\n),\n\ncountry_codes as (\n\n select * \n from {{ var('apple_store_country_codes') }}\n),\n\ndownloads_territory as (\n\n select *\n from {{ var('downloads_territory') }}\n),\n\nusage_territory as (\n\n select * \n from {{ var('usage_territory') }}\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type,\n territory \n from app_store_territory\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n reporting_grain.source_type,\n reporting_grain.territory as territory_long,\n coalesce(official_country_codes.country_code_alpha_2, alternative_country_codes.country_code_alpha_2) as territory_short,\n coalesce(official_country_codes.region, alternative_country_codes.region) as region,\n coalesce(official_country_codes.sub_region, alternative_country_codes.sub_region) as sub_region,\n coalesce(app_store_territory.impressions, 0) as impressions,\n coalesce(app_store_territory.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_territory.page_views, 0) as page_views,\n coalesce(app_store_territory.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(downloads_territory.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_territory.redownloads, 0) as redownloads,\n coalesce(downloads_territory.total_downloads, 0) as total_downloads,\n coalesce(usage_territory.active_devices, 0) as active_devices,\n coalesce(usage_territory.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_territory.deletions, 0) as deletions,\n coalesce(usage_territory.installations, 0) as installations,\n coalesce(usage_territory.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_territory \n on reporting_grain.date_day = app_store_territory.date_day\n and reporting_grain.app_id = app_store_territory.app_id \n and reporting_grain.source_type = app_store_territory.source_type\n and reporting_grain.territory = app_store_territory.territory\n left join downloads_territory\n on reporting_grain.date_day = downloads_territory.date_day\n and reporting_grain.app_id = downloads_territory.app_id \n and reporting_grain.source_type = downloads_territory.source_type\n and reporting_grain.territory = downloads_territory.territory\n left join usage_territory\n on reporting_grain.date_day = usage_territory.date_day\n and reporting_grain.app_id = usage_territory.app_id \n and reporting_grain.source_type = usage_territory.source_type\n and reporting_grain.territory = usage_territory.territory\n left join country_codes as official_country_codes\n on reporting_grain.territory = official_country_codes.country_name\n left join country_codes as alternative_country_codes\n on reporting_grain.territory = alternative_country_codes.alternative_country_name\n)\n\nselect * from joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_territory", "seed.apple_store_source.apple_store_country_codes", "model.apple_store_source.stg_apple_store__downloads_territory", "model.apple_store_source.stg_apple_store__usage_territory"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__territory_report"], "unique_id": "model.apple_store.apple_store__territory_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__territory_report.sql", "original_file_path": "models/apple_store__territory_report.sql", "name": "apple_store__territory_report", "alias": "apple_store__territory_report", "checksum": {"name": "sha256", "checksum": "3abe3537eb31f9381a3bc03265d1349dbaa48f06d035e9d38fdde8f904897fb1"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__app_store_territory"], ["apple_store_country_codes"], ["stg_apple_store__downloads_territory"], ["stg_apple_store__usage_territory"]], "sources": [], "description": "Each record represents daily subscription metrics by app_id, source_type and territory", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory_long": {"name": "territory_long", "description": "The territory (aka country) full name associated with the report's respective metric(s). Territory_long uses source territories for the following: downloads, usage and app store; territory_long is inferred from ISO-3166 using the 2-character country code for subscription events and subscription summary. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory_short": {"name": "territory_short", "description": "The 2-character country code associated with the report's respective metric(s). Territory_short uses source 2-character country codes for the subscription events and subscription summary; territory_short is inferred from ISO-3166 using source territories for the following: downloads, usage and app store. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region": {"name": "region", "description": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region": {"name": "sub_region", "description": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__territory_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1652983819.1533382, "compiled_sql": "with app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_territory as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory`\n),\n\ncountry_codes as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`apple_store_country_codes`\n),\n\ndownloads_territory as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory`\n),\n\nusage_territory as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory`\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type,\n territory \n from app_store_territory\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n reporting_grain.source_type,\n reporting_grain.territory as territory_long,\n coalesce(official_country_codes.country_code_alpha_2, alternative_country_codes.country_code_alpha_2) as territory_short,\n coalesce(official_country_codes.region, alternative_country_codes.region) as region,\n coalesce(official_country_codes.sub_region, alternative_country_codes.sub_region) as sub_region,\n coalesce(app_store_territory.impressions, 0) as impressions,\n coalesce(app_store_territory.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_territory.page_views, 0) as page_views,\n coalesce(app_store_territory.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(downloads_territory.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_territory.redownloads, 0) as redownloads,\n coalesce(downloads_territory.total_downloads, 0) as total_downloads,\n coalesce(usage_territory.active_devices, 0) as active_devices,\n coalesce(usage_territory.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_territory.deletions, 0) as deletions,\n coalesce(usage_territory.installations, 0) as installations,\n coalesce(usage_territory.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_territory \n on reporting_grain.date_day = app_store_territory.date_day\n and reporting_grain.app_id = app_store_territory.app_id \n and reporting_grain.source_type = app_store_territory.source_type\n and reporting_grain.territory = app_store_territory.territory\n left join downloads_territory\n on reporting_grain.date_day = downloads_territory.date_day\n and reporting_grain.app_id = downloads_territory.app_id \n and reporting_grain.source_type = downloads_territory.source_type\n and reporting_grain.territory = downloads_territory.territory\n left join usage_territory\n on reporting_grain.date_day = usage_territory.date_day\n and reporting_grain.app_id = usage_territory.app_id \n and reporting_grain.source_type = usage_territory.source_type\n and reporting_grain.territory = usage_territory.territory\n left join country_codes as official_country_codes\n on reporting_grain.territory = official_country_codes.country_name\n left join country_codes as alternative_country_codes\n on reporting_grain.territory = alternative_country_codes.alternative_country_name\n)\n\nselect * from joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__territory_report`"}, "model.apple_store.apple_store__device_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_device as (\n\n select *\n from {{ var('app_store_device') }}\n),\n\ndownloads_device as (\n\n select *\n from {{ var('downloads_device') }}\n),\n\nusage_device as (\n\n select *\n from {{ var('usage_device') }}\n),\n\ncrashes_device as (\n\n select *\n from {{ ref('int_apple_store__crashes_device') }}\n),\n\n{% if var('apple_store__using_subscriptions', False) %}\nsubscription_device as (\n\n select *\n from {{ ref('int_apple_store__subscription_device') }}\n),\n{% endif %}\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n device \n from app_store_device\n union all\n select\n date_day,\n app_id,\n source_type,\n device\n from crashes_device\n),\n\nreporting_grain as (\n \n select\n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.device,\n coalesce(app_store_device.impressions, 0) as impressions,\n coalesce(app_store_device.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_device.page_views, 0) as page_views,\n coalesce(app_store_device.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_device.crashes, 0) as crashes,\n coalesce(downloads_device.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_device.redownloads, 0) as redownloads,\n coalesce(downloads_device.total_downloads, 0) as total_downloads,\n coalesce(usage_device.active_devices, 0) as active_devices,\n coalesce(usage_device.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_device.deletions, 0) as deletions,\n coalesce(usage_device.installations, 0) as installations,\n coalesce(usage_device.sessions, 0) as sessions\n {% if var('apple_store__using_subscriptions', False) %}\n ,\n coalesce(subscription_device.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscription_device.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_a_you_go_introductory_offer_subscriptions,\n coalesce(subscription_device.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscription_device.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce({{ 'subscription_device.' ~ event_column }}, 0)\n as {{ event_column }} \n {% endfor %}\n {% endif %}\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_device \n on reporting_grain.date_day = app_store_device.date_day\n and reporting_grain.app_id = app_store_device.app_id \n and reporting_grain.source_type = app_store_device.source_type\n and reporting_grain.device = app_store_device.device\n left join crashes_device\n on reporting_grain.date_day = crashes_device.date_day\n and reporting_grain.app_id = crashes_device.app_id\n and reporting_grain.source_type = crashes_device.source_type\n and reporting_grain.device = crashes_device.device\n left join downloads_device\n on reporting_grain.date_day = downloads_device.date_day\n and reporting_grain.app_id = downloads_device.app_id \n and reporting_grain.source_type = downloads_device.source_type\n and reporting_grain.device = downloads_device.device\n {% if var('apple_store__using_subscriptions', False) %}\n left join subscription_device\n on reporting_grain.date_day = subscription_device.date_day\n and reporting_grain.app_id = subscription_device.app_id \n and reporting_grain.source_type = subscription_device.source_type\n and reporting_grain.device = subscription_device.device\n {% endif %}\n left join usage_device\n on reporting_grain.date_day = usage_device.date_day\n and reporting_grain.app_id = usage_device.app_id \n and reporting_grain.source_type = usage_device.source_type\n and reporting_grain.device = usage_device.device\n)\n\nselect * from joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_device", "model.apple_store_source.stg_apple_store__downloads_device", "model.apple_store_source.stg_apple_store__usage_device", "model.apple_store.int_apple_store__crashes_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__device_report"], "unique_id": "model.apple_store.apple_store__device_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__device_report.sql", "original_file_path": "models/apple_store__device_report.sql", "name": "apple_store__device_report", "alias": "apple_store__device_report", "checksum": {"name": "sha256", "checksum": "f081e8b39da44a9c25bd478e646faf210e5e526fcf100ce399d33bb95ac0eb8d"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__app_store_device"], ["stg_apple_store__downloads_device"], ["stg_apple_store__usage_device"], ["int_apple_store__crashes_device"]], "sources": [], "description": "Each record represents daily subscription metrics by app_id, source_type and device", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__device_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1652983819.158773, "compiled_sql": "with __dbt__cte__int_apple_store__crashes_device as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_device as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\ndownloads_device as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\nusage_device as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\ncrashes_device as (\n\n select *\n from __dbt__cte__int_apple_store__crashes_device\n),\n\n\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n device \n from app_store_device\n union all\n select\n date_day,\n app_id,\n source_type,\n device\n from crashes_device\n),\n\nreporting_grain as (\n \n select\n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.device,\n coalesce(app_store_device.impressions, 0) as impressions,\n coalesce(app_store_device.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_device.page_views, 0) as page_views,\n coalesce(app_store_device.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_device.crashes, 0) as crashes,\n coalesce(downloads_device.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_device.redownloads, 0) as redownloads,\n coalesce(downloads_device.total_downloads, 0) as total_downloads,\n coalesce(usage_device.active_devices, 0) as active_devices,\n coalesce(usage_device.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_device.deletions, 0) as deletions,\n coalesce(usage_device.installations, 0) as installations,\n coalesce(usage_device.sessions, 0) as sessions\n \n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_device \n on reporting_grain.date_day = app_store_device.date_day\n and reporting_grain.app_id = app_store_device.app_id \n and reporting_grain.source_type = app_store_device.source_type\n and reporting_grain.device = app_store_device.device\n left join crashes_device\n on reporting_grain.date_day = crashes_device.date_day\n and reporting_grain.app_id = crashes_device.app_id\n and reporting_grain.source_type = crashes_device.source_type\n and reporting_grain.device = crashes_device.device\n left join downloads_device\n on reporting_grain.date_day = downloads_device.date_day\n and reporting_grain.app_id = downloads_device.app_id \n and reporting_grain.source_type = downloads_device.source_type\n and reporting_grain.device = downloads_device.device\n \n left join usage_device\n on reporting_grain.date_day = usage_device.date_day\n and reporting_grain.app_id = usage_device.app_id \n and reporting_grain.source_type = usage_device.source_type\n and reporting_grain.device = usage_device.device\n)\n\nselect * from joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__crashes_device", "sql": " __dbt__cte__int_apple_store__crashes_device as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__device_report`"}, "model.apple_store.apple_store__app_version_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\ncrashes_app_version_report as (\n \n select *\n from {{ ref('int_apple_store__crashes_app_version') }}\n),\n\nusage_app_version_report as (\n\n select *\n from {{ var('usage_app_version') }}\n),\n\nreporting_grain_combined as (\n \n select\n date_day,\n app_id,\n source_type,\n app_version\n from usage_app_version_report\n union all \n select \n date_day,\n app_id,\n source_type,\n app_version\n from crashes_app_version_report\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.app_version,\n coalesce(crashes_app_version_report.crashes, 0) as crashes,\n coalesce(usage_app_version_report.active_devices, 0) as active_devices,\n coalesce(usage_app_version_report.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_app_version_report.deletions, 0) as deletions,\n coalesce(usage_app_version_report.installations, 0) as installations,\n coalesce(usage_app_version_report.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join crashes_app_version_report\n on reporting_grain.date_day = crashes_app_version_report.date_day\n and reporting_grain.app_id = crashes_app_version_report.app_id\n and reporting_grain.source_type = crashes_app_version_report.source_type\n and reporting_grain.app_version = crashes_app_version_report.app_version\n left join usage_app_version_report\n on reporting_grain.date_day = usage_app_version_report.date_day\n and reporting_grain.app_id = usage_app_version_report.app_id \n and reporting_grain.source_type = usage_app_version_report.source_type\n and reporting_grain.app_version = usage_app_version_report.app_version\n)\n\nselect * from joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store.int_apple_store__crashes_app_version", "model.apple_store_source.stg_apple_store__usage_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__app_version_report"], "unique_id": "model.apple_store.apple_store__app_version_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__app_version_report.sql", "original_file_path": "models/apple_store__app_version_report.sql", "name": "apple_store__app_version_report", "alias": "apple_store__app_version_report", "checksum": {"name": "sha256", "checksum": "9d4c557f2ad4cd7c4f6487c10f0c13076e3cfbbed28704834b88c4c830c4220d"}, "tags": [], "refs": [["stg_apple_store__app"], ["int_apple_store__crashes_app_version"], ["stg_apple_store__usage_app_version"]], "sources": [], "description": "Each record represents daily metrics for each by app_id, source_type and app version", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__app_version_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1652983819.1785338, "compiled_sql": "with __dbt__cte__int_apple_store__crashes_app_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\ncrashes_app_version_report as (\n \n select *\n from __dbt__cte__int_apple_store__crashes_app_version\n),\n\nusage_app_version_report as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version`\n),\n\nreporting_grain_combined as (\n \n select\n date_day,\n app_id,\n source_type,\n app_version\n from usage_app_version_report\n union all \n select \n date_day,\n app_id,\n source_type,\n app_version\n from crashes_app_version_report\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.app_version,\n coalesce(crashes_app_version_report.crashes, 0) as crashes,\n coalesce(usage_app_version_report.active_devices, 0) as active_devices,\n coalesce(usage_app_version_report.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_app_version_report.deletions, 0) as deletions,\n coalesce(usage_app_version_report.installations, 0) as installations,\n coalesce(usage_app_version_report.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join crashes_app_version_report\n on reporting_grain.date_day = crashes_app_version_report.date_day\n and reporting_grain.app_id = crashes_app_version_report.app_id\n and reporting_grain.source_type = crashes_app_version_report.source_type\n and reporting_grain.app_version = crashes_app_version_report.app_version\n left join usage_app_version_report\n on reporting_grain.date_day = usage_app_version_report.date_day\n and reporting_grain.app_id = usage_app_version_report.app_id \n and reporting_grain.source_type = usage_app_version_report.source_type\n and reporting_grain.app_version = usage_app_version_report.app_version\n)\n\nselect * from joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__crashes_app_version", "sql": " __dbt__cte__int_apple_store__crashes_app_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__app_version_report`"}, "model.apple_store.apple_store__overview_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store as (\n\n select *\n from {{ ref('int_apple_store__app_store_overview') }}\n),\n\ncrashes as (\n\n select *\n from {{ ref('int_apple_store__crashes_overview') }}\n),\n\ndownloads as (\n\n select *\n from {{ ref('int_apple_store__downloads_overview') }}\n),\n\n{% if var('apple_store__using_subscriptions', False) %}\nsubscriptions as (\n\n select *\n from {{ ref('int_apple_store__sales_subscription_overview') }}\n), \n{% endif %}\n\nusage as (\n\n select *\n from {{ ref('int_apple_store__usage_overview') }}\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id \n from app_store\n), \n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n coalesce(app_store.impressions, 0) as impressions,\n coalesce(app_store.page_views, 0) as page_views,\n coalesce(crashes.crashes,0) as crashes,\n coalesce(downloads.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads.redownloads, 0) as redownloads,\n coalesce(downloads.total_downloads, 0) as total_downloads,\n coalesce(usage.active_devices, 0) as active_devices,\n coalesce(usage.deletions, 0) as deletions,\n coalesce(usage.installations, 0) as installations,\n coalesce(usage.sessions, 0) as sessions\n {% if var('apple_store__using_subscriptions', False) %}\n ,\n coalesce(subscriptions.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscriptions.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_as_you_go_introductory_offer_subscriptions,\n coalesce(subscriptions.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscriptions.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce({{ 'subscriptions.' ~ event_column }}, 0)\n as {{ event_column }} \n {% endfor %}\n {% endif %}\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store \n on reporting_grain.date_day = app_store.date_day\n and reporting_grain.app_id = app_store.app_id\n left join crashes\n on reporting_grain.date_day = crashes.date_day\n and reporting_grain.app_id = crashes.app_id\n left join downloads\n on reporting_grain.date_day = downloads.date_day\n and reporting_grain.app_id = downloads.app_id\n {% if var('apple_store__using_subscriptions', False) %}\n left join subscriptions \n on reporting_grain.date_day = subscriptions.date_day\n and reporting_grain.app_id = subscriptions.app_id\n {% endif %}\n left join usage\n on reporting_grain.date_day = usage.date_day\n and reporting_grain.app_id = usage.app_id \n)\n\nselect * from joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store.int_apple_store__app_store_overview", "model.apple_store.int_apple_store__crashes_overview", "model.apple_store.int_apple_store__downloads_overview", "model.apple_store.int_apple_store__usage_overview"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__overview_report"], "unique_id": "model.apple_store.apple_store__overview_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__overview_report.sql", "original_file_path": "models/apple_store__overview_report.sql", "name": "apple_store__overview_report", "alias": "apple_store__overview_report", "checksum": {"name": "sha256", "checksum": "cb53f7caa3cfb02c32811cbfd66bab1913c21caa1155de1991644d8e14b8ff10"}, "tags": [], "refs": [["stg_apple_store__app"], ["int_apple_store__app_store_overview"], ["int_apple_store__crashes_overview"], ["int_apple_store__downloads_overview"], ["int_apple_store__usage_overview"]], "sources": [], "description": "Each record represents daily metrics for each app_id", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__overview_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1652983819.167229, "compiled_sql": "with __dbt__cte__int_apple_store__app_store_overview as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2\n\n)\n\nselect * from aggregated\n), __dbt__cte__int_apple_store__crashes_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n group by 1,2\n)\n\nselect * from aggregated\n), __dbt__cte__int_apple_store__downloads_overview as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2\n)\n\nselect * from aggregated\n), __dbt__cte__int_apple_store__usage_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2\n)\n\nselect * from aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store as (\n\n select *\n from __dbt__cte__int_apple_store__app_store_overview\n),\n\ncrashes as (\n\n select *\n from __dbt__cte__int_apple_store__crashes_overview\n),\n\ndownloads as (\n\n select *\n from __dbt__cte__int_apple_store__downloads_overview\n),\n\n\n\nusage as (\n\n select *\n from __dbt__cte__int_apple_store__usage_overview\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id \n from app_store\n), \n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n coalesce(app_store.impressions, 0) as impressions,\n coalesce(app_store.page_views, 0) as page_views,\n coalesce(crashes.crashes,0) as crashes,\n coalesce(downloads.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads.redownloads, 0) as redownloads,\n coalesce(downloads.total_downloads, 0) as total_downloads,\n coalesce(usage.active_devices, 0) as active_devices,\n coalesce(usage.deletions, 0) as deletions,\n coalesce(usage.installations, 0) as installations,\n coalesce(usage.sessions, 0) as sessions\n \n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store \n on reporting_grain.date_day = app_store.date_day\n and reporting_grain.app_id = app_store.app_id\n left join crashes\n on reporting_grain.date_day = crashes.date_day\n and reporting_grain.app_id = crashes.app_id\n left join downloads\n on reporting_grain.date_day = downloads.date_day\n and reporting_grain.app_id = downloads.app_id\n \n left join usage\n on reporting_grain.date_day = usage.date_day\n and reporting_grain.app_id = usage.app_id \n)\n\nselect * from joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__app_store_overview", "sql": " __dbt__cte__int_apple_store__app_store_overview as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2\n\n)\n\nselect * from aggregated\n)"}, {"id": "model.apple_store.int_apple_store__crashes_overview", "sql": " __dbt__cte__int_apple_store__crashes_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n group by 1,2\n)\n\nselect * from aggregated\n)"}, {"id": "model.apple_store.int_apple_store__downloads_overview", "sql": " __dbt__cte__int_apple_store__downloads_overview as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2\n)\n\nselect * from aggregated\n)"}, {"id": "model.apple_store.int_apple_store__usage_overview", "sql": " __dbt__cte__int_apple_store__usage_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2\n)\n\nselect * from aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__overview_report`"}, "model.apple_store.int_apple_store__app_store_source_type": {"raw_sql": "with base as (\n\n select * \n from {{ var('app_store_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n {{ dbt_utils.group_by(3) }}\n\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "source_type_report", "int_apple_store__app_store_source_type"], "unique_id": "model.apple_store.int_apple_store__app_store_source_type", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/source_type_report/int_apple_store__app_store_source_type.sql", "original_file_path": "models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql", "name": "int_apple_store__app_store_source_type", "alias": "int_apple_store__app_store_source_type", "checksum": {"name": "sha256", "checksum": "1f685f11c12c0eb0c5f9860fdfa176b4149116e92ab58fc6b2f6d6306e3a0b80"}, "tags": [], "refs": [["stg_apple_store__app_store_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.862379, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2,3\n\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__downloads_source_type": {"raw_sql": "with base as (\n \n select * \n from {{ var('downloads_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n {{ dbt_utils.group_by(3) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "source_type_report", "int_apple_store__downloads_source_type"], "unique_id": "model.apple_store.int_apple_store__downloads_source_type", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/source_type_report/int_apple_store__downloads_source_type.sql", "original_file_path": "models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql", "name": "int_apple_store__downloads_source_type", "alias": "int_apple_store__downloads_source_type", "checksum": {"name": "sha256", "checksum": "7cf83291b0b847dad61050a9570b54b5a9630450e87dabf3b50721c32774ba93"}, "tags": [], "refs": [["stg_apple_store__downloads_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.8688378, "compiled_sql": "with base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2,3\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__usage_source_type": {"raw_sql": "with base as (\n\n select *\n from {{ var('usage_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n {{ dbt_utils.group_by(3) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "source_type_report", "int_apple_store__usage_source_type"], "unique_id": "model.apple_store.int_apple_store__usage_source_type", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/source_type_report/int_apple_store__usage_source_type.sql", "original_file_path": "models/intermediate/source_type_report/int_apple_store__usage_source_type.sql", "name": "int_apple_store__usage_source_type", "alias": "int_apple_store__usage_source_type", "checksum": {"name": "sha256", "checksum": "5bb7ee3a06ea9fb6f5c61803b633ea069ba3eb2730f1bb7bafa95bc851b4fb19"}, "tags": [], "refs": [["stg_apple_store__usage_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/source_type_report/int_apple_store__usage_source_type.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.874274, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2,3\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__usage_overview": {"raw_sql": "with base as (\n\n select *\n from {{ var('usage_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n {{ dbt_utils.group_by(2) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__usage_overview"], "unique_id": "model.apple_store.int_apple_store__usage_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__usage_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__usage_overview.sql", "name": "int_apple_store__usage_overview", "alias": "int_apple_store__usage_overview", "checksum": {"name": "sha256", "checksum": "286172a458fab9913e3e4bf542915c964df031329344fdaa52562d14058f694a"}, "tags": [], "refs": [["stg_apple_store__usage_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__usage_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.885657, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__downloads_overview": {"raw_sql": "with base as (\n \n select * \n from {{ var('downloads_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n {{ dbt_utils.group_by(2) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__downloads_overview"], "unique_id": "model.apple_store.int_apple_store__downloads_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__downloads_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__downloads_overview.sql", "name": "int_apple_store__downloads_overview", "alias": "int_apple_store__downloads_overview", "checksum": {"name": "sha256", "checksum": "138ec1e995ae8e2285903fc34a5d6b1dda759be99ca2d6c73ffcf0ee594bec5b"}, "tags": [], "refs": [["stg_apple_store__downloads_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__downloads_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.8900428, "compiled_sql": "with base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__crashes_overview": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_app_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(2) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__crashes_overview"], "unique_id": "model.apple_store.int_apple_store__crashes_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__crashes_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__crashes_overview.sql", "name": "int_apple_store__crashes_overview", "alias": "int_apple_store__crashes_overview", "checksum": {"name": "sha256", "checksum": "24e081894443ee09021770d23bd303aed1921f2ecfbb0c02265925555990e027"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__crashes_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.894445, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n group by 1,2\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__app_store_overview": {"raw_sql": "with base as (\n\n select * \n from {{ var('app_store_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n {{ dbt_utils.group_by(2) }}\n\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__app_store_overview"], "unique_id": "model.apple_store.int_apple_store__app_store_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__app_store_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__app_store_overview.sql", "name": "int_apple_store__app_store_overview", "alias": "int_apple_store__app_store_overview", "checksum": {"name": "sha256", "checksum": "0fd9d6e1e2e0f383a953f55f360f77d50ea3fc4120f075b25074c98a5b2c84bf"}, "tags": [], "refs": [["stg_apple_store__app_store_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__app_store_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.899723, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2\n\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__platform_version": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_platform_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as {{ dbt_utils.type_string() }}) as source_type,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(4) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_platform_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "platform_version_report", "int_apple_store__platform_version"], "unique_id": "model.apple_store.int_apple_store__platform_version", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/platform_version_report/int_apple_store__platform_version.sql", "original_file_path": "models/intermediate/platform_version_report/int_apple_store__platform_version.sql", "name": "int_apple_store__platform_version", "alias": "int_apple_store__platform_version", "checksum": {"name": "sha256", "checksum": "d2a2513790cee23737684abe298cbd3638e58cb16ba2231b7c761bb7d7b33a04"}, "tags": [], "refs": [["stg_apple_store__crashes_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/platform_version_report/int_apple_store__platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.904066, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__crashes_app_version": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_app_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as {{ dbt_utils.type_string() }}) as source_type,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(4) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "app_version_report", "int_apple_store__crashes_app_version"], "unique_id": "model.apple_store.int_apple_store__crashes_app_version", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/app_version_report/int_apple_store__crashes_app_version.sql", "original_file_path": "models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql", "name": "int_apple_store__crashes_app_version", "alias": "int_apple_store__crashes_app_version", "checksum": {"name": "sha256", "checksum": "70c93962d3b067a0ff5e776d284d732bf20c0be0067faa554a36ccefd79216ef"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.908703, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__crashes_device": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_app_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as {{ dbt_utils.type_string() }}) as source_type,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(4) }}\n)\n\nselect * from aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "device_report", "int_apple_store__crashes_device"], "unique_id": "model.apple_store.int_apple_store__crashes_device", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/device_report/int_apple_store__crashes_device.sql", "original_file_path": "models/intermediate/device_report/int_apple_store__crashes_device.sql", "name": "int_apple_store__crashes_device", "alias": "int_apple_store__crashes_device", "checksum": {"name": "sha256", "checksum": "30cd1407fb321ab3718b9d4ead9019c2b5f87521cc1e413f2eb550110b8830bb"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/device_report/int_apple_store__crashes_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1652983818.94227, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * from aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "app_id", "model": "{{ get_where_subquery(ref('stg_apple_store__app')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app"]}, "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": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "unique_stg_apple_store__app_app_id"], "unique_id": "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "unique_stg_apple_store__app_app_id.sql", "original_file_path": "models/stg_apple_store.yml", "name": "unique_stg_apple_store__app_app_id", "alias": "unique_stg_apple_store__app_app_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/unique_stg_apple_store__app_app_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1652983819.0606878, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select app_id as unique_field\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n where app_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "app_id", "file_key_name": "models.stg_apple_store__app"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('stg_apple_store__app_store_device')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app_store_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5"}, "created_at": 1652983819.062325, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__app_store_device"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__app_store_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app_store_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9"}, "created_at": 1652983819.0739682, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__app_store_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory"], "model": "{{ get_where_subquery(ref('stg_apple_store__app_store_territory')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_territory"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory", "alias": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app_store_territory"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab"}, "created_at": 1652983819.0784981, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory`\n group by date_day, app_id, source_type, territory\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__app_store_territory"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "device", "app_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__crashes_app_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version", "alias": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030"}, "created_at": 1652983819.083027, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, device, app_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n group by date_day, app_id, device, app_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__crashes_app_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "device", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__crashes_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version", "alias": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__crashes_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd"}, "created_at": 1652983819.087544, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, device, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n group by date_day, app_id, device, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__crashes_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('stg_apple_store__downloads_device')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__downloads_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd"}, "created_at": 1652983819.092062, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__downloads_device"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__downloads_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__downloads_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e"}, "created_at": 1652983819.096622, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__downloads_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory"], "model": "{{ get_where_subquery(ref('stg_apple_store__downloads_territory')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_territory"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory", "alias": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__downloads_territory"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d"}, "created_at": 1652983819.101129, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory`\n group by date_day, app_id, source_type, territory\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__downloads_territory"}, "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_apple_store__sales_account')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__sales_account"]}, "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": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "unique_stg_apple_store__sales_account_account_id"], "unique_id": "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "unique_stg_apple_store__sales_account_account_id.sql", "original_file_path": "models/stg_apple_store.yml", "name": "unique_stg_apple_store__sales_account_account_id", "alias": "unique_stg_apple_store__sales_account_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/unique_stg_apple_store__sales_account_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1652983819.1057012, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select account_id as unique_field\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n where account_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id", "file_key_name": "models.stg_apple_store__sales_account"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id", "app_name", "subscription_name", "device", "event", "country", "state"], "model": "{{ get_where_subquery(ref('stg_apple_store__sales_subscription_events')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": []}, "config": {"enabled": false, "alias": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state", "alias": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a"}, "created_at": 1652983819.107223, "column_name": null, "file_key_name": "models.stg_apple_store__sales_subscription_events"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id", "app_name", "subscription_name", "device", "country", "state"], "model": "{{ get_where_subquery(ref('stg_apple_store__sales_subscription_summary')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": []}, "config": {"enabled": false, "alias": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state", "alias": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__sales_subscription_summary"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37"}, "created_at": 1652983819.1128268, "column_name": null, "file_key_name": "models.stg_apple_store__sales_subscription_summary"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "app_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_app_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_app_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version", "alias": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735"}, "created_at": 1652983819.118391, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, app_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version`\n group by date_day, app_id, source_type, app_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_app_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_device')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d"}, "created_at": 1652983819.123822, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_device"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789"}, "created_at": 1652983819.1284218, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_territory')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_territory"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory", "alias": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_territory"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04"}, "created_at": 1652983819.133009, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory`\n group by date_day, app_id, source_type, territory\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_territory"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id", "app_id", "subscription_name", "territory_long", "state"], "model": "{{ get_where_subquery(ref('apple_store__subscription_report')) }}"}, "namespace": "dbt_utils"}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": []}, "config": {"enabled": false, "alias": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state", "alias": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__subscription_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490"}, "created_at": 1652983819.17926, "column_name": null, "file_key_name": "models.apple_store__subscription_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory_long"], "model": "{{ get_where_subquery(ref('apple_store__territory_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__territory_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long", "alias": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__territory_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd"}, "created_at": 1652983819.1845162, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory_long\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__territory_report`\n group by date_day, app_id, source_type, territory_long\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__territory_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('apple_store__device_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__device_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__device_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1"}, "created_at": 1652983819.189055, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__device_report`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__device_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type"], "model": "{{ get_where_subquery(ref('apple_store__source_type_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__source_type_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type", "alias": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__source_type_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041"}, "created_at": 1652983819.193681, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__source_type_report`\n group by date_day, app_id, source_type\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__source_type_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id"], "model": "{{ get_where_subquery(ref('apple_store__overview_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__overview_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id", "alias": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__overview_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7"}, "created_at": 1652983819.1979342, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__overview_report`\n group by date_day, app_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__overview_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('apple_store__platform_version_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__platform_version_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__platform_version_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08"}, "created_at": 1652983819.202243, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__platform_version_report`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__platform_version_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "app_version"], "model": "{{ get_where_subquery(ref('apple_store__app_version_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__app_version_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version", "alias": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__app_version_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea"}, "created_at": 1652983819.206762, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, app_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__app_version_report`\n group by date_day, app_id, source_type, app_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__app_version_report"}}, "sources": {"source.apple_store_source.apple_store.app": {"fqn": ["apple_store_source", "apple_store", "app"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.app", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing data about your application(s)", "columns": {"id": {"name": "id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicator for whether application is enabled or not.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`app`", "created_at": 1652983819.2110631}, "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "app_store_platform_version_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.app_store_platform_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app_store_platform_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app_store_platform_version_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`app_store_platform_version_source_type_report`", "created_at": 1652983819.211207}, "source.apple_store_source.apple_store.app_store_source_type_device_report": {"fqn": ["apple_store_source", "apple_store", "app_store_source_type_device_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.app_store_source_type_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app_store_source_type_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app_store_source_type_device_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by device and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`app_store_source_type_device_report`", "created_at": 1652983819.211333}, "source.apple_store_source.apple_store.app_store_territory_source_type_report": {"fqn": ["apple_store_source", "apple_store", "app_store_territory_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.app_store_territory_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app_store_territory_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app_store_territory_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by territory and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`app_store_territory_source_type_report`", "created_at": 1652983819.2114549}, "source.apple_store_source.apple_store.crashes_app_version_device_report": {"fqn": ["apple_store_source", "apple_store", "crashes_app_version_device_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.crashes_app_version_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "crashes_app_version_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "crashes_app_version_device_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily crashes by app version and device.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`crashes_app_version_device_report`", "created_at": 1652983819.211571}, "source.apple_store_source.apple_store.crashes_platform_version_device_report": {"fqn": ["apple_store_source", "apple_store", "crashes_platform_version_device_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.crashes_platform_version_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "crashes_platform_version_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "crashes_platform_version_device_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily crashes by platform version and device.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`crashes_platform_version_device_report`", "created_at": 1652983819.2116868}, "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "downloads_platform_version_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.downloads_platform_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "downloads_platform_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "downloads_platform_version_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`downloads_platform_version_source_type_report`", "created_at": 1652983819.2118049}, "source.apple_store_source.apple_store.downloads_source_type_device_report": {"fqn": ["apple_store_source", "apple_store", "downloads_source_type_device_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.downloads_source_type_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "downloads_source_type_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "downloads_source_type_device_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by device and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`downloads_source_type_device_report`", "created_at": 1652983819.211923}, "source.apple_store_source.apple_store.downloads_territory_source_type_report": {"fqn": ["apple_store_source", "apple_store", "downloads_territory_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.downloads_territory_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "downloads_territory_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "downloads_territory_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by territory and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`downloads_territory_source_type_report`", "created_at": 1652983819.212039}, "source.apple_store_source.apple_store.sales_account": {"fqn": ["apple_store_source", "apple_store", "sales_account"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.sales_account", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "sales_account", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "sales_account", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing sales account data.", "columns": {"id": {"name": "id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Sales Account Name associated with the Sales Account ID, app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`sales_account`", "created_at": 1652983819.212149}, "source.apple_store_source.apple_store.sales_subscription_event_summary": {"fqn": ["apple_store_source", "apple_store", "sales_subscription_event_summary"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.sales_subscription_event_summary", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "sales_subscription_event_summary", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "sales_subscription_event_summary", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily subscription event report by account ID, app name, subscription name, event, country, state and device; this model is aggregated by date, app_name, account_id, country, state and subscription_name for easier transformations in the modeling package.", "columns": {"event_date": {"name": "event_date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "event": {"name": "event", "description": "The subscription event associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of occurrences of a given subscription event.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": false}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`sales_subscription_event_summary`", "created_at": 1652983819.212268}, "source.apple_store_source.apple_store.sales_subscription_summary": {"fqn": ["apple_store_source", "apple_store", "sales_subscription_summary"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.sales_subscription_summary", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "sales_subscription_summary", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "sales_subscription_summary", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily subscription summary report by account ID, app name, country, state and subscription name; this model is aggregated by date, app_name, account_id, country, state and subscription_name for easier transformations in the modeling package.", "columns": {"_filename": {"name": "_filename", "description": "Report filenames used to extract the date of the report", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_free_trial_introductory_offer_subscriptions": {"name": "active_free_trial_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently in a free trial.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_pay_as_you_go_introductory_offer_subscriptions": {"name": "active_pay_as_you_go_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently with a pay as you go introductory price.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_pay_up_front_introductory_offer_subscriptions": {"name": "active_pay_up_front_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently with a pay up front introductory price.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_standard_price_subscriptions": {"name": "active_standard_price_subscriptions", "description": "Total number of auto-renewable standard paid subscriptions currently active, excluding free trials, \nsubscription offers, introductory offers, and marketing opt-ins. Subscriptions are active during the period for which the customer has paid without cancellation.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": false}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`sales_subscription_summary`", "created_at": 1652983819.212391}, "source.apple_store_source.apple_store.usage_app_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "usage_app_version_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.usage_app_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_app_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_app_version_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by app version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`usage_app_version_source_type_report`", "created_at": 1652983819.212509}, "source.apple_store_source.apple_store.usage_platform_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "usage_platform_version_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.usage_platform_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_platform_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_platform_version_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`usage_platform_version_source_type_report`", "created_at": 1652983819.212627}, "source.apple_store_source.apple_store.usage_source_type_device_report": {"fqn": ["apple_store_source", "apple_store", "usage_source_type_device_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.usage_source_type_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_source_type_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_source_type_device_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by device and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`usage_source_type_device_report`", "created_at": 1652983819.212746}, "source.apple_store_source.apple_store.usage_territory_source_type_report": {"fqn": ["apple_store_source", "apple_store", "usage_territory_source_type_report"], "database": "dbt-package-testing", "schema": "itunes_connect", "unique_id": "source.apple_store_source.apple_store.usage_territory_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_territory_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_territory_source_type_report", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by territory and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`itunes_connect`.`usage_territory_source_type_report`", "created_at": 1652983819.212863}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.347147}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3476741}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.348344}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.354773}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.364335}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3651352}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.365897}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3664582}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, 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": 1652983817.367796}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3683252}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.369}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__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": 1652983817.369285}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3695629}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.369984}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.370306}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3706172}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/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": 1652983817.370792}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/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": 1652983817.3712041}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.371629}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.372021}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.372618}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.372959}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.373294}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.374149}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.374957}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3763862}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3767512}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.377463}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3778088}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.379083}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.380225}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3814888}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.385094}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.387512}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.39074}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", 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": 1652983817.391708}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.3944378}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.396249}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4017448}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.402669}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.402998}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4032829}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.405469}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.40589}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4062011}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.406512}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.406822}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.407669}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.40831}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.408957}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4099069}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.410469}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.416495}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.416852}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.417325}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.417631}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.417846}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.419313}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.41966}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.420026}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\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": 1652983817.422047}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \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": 1652983817.425994}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.431078}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4316769}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.432035}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.432232}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.432662}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.434498}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.434897}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.435436}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set 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": 1652983817.436339}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\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": 1652983817.446114}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4497778}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.450652}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.451235}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.451992}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.452707}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4543319}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4553988}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }} \n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.456529}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.460746}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set 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": 1652983817.4629161}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4633532}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key 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": 1652983817.4641438}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.464638}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- 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": 1652983817.465909}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.467175}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n \n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.475567}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.482632}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.484891}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.487102}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n \n {% do exceptions.raise_compiler_error(fail_msg) %}\n \n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n \n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {% endif %}\n \n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4884841}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4947321}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.495591}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.495939}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.4963179}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n \n {{ sql_header if sql_header is not none }}\n \n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.497078}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.502995}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.503664}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5040839}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.506271}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.507015}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5073228}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.507664}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.508152}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set 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": 1652983817.5131478}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5189178}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.520592}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.521065}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.521973}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.522253}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.522481}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.522789}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.523017}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5239081}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5244522}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.52673}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5275168}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5279539}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.52893}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5294342}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.529968}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.530776}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.531262}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.53199}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\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": 1652983817.53246}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.533046}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.534165}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% 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": 1652983817.5361469}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.537211}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.537761}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.540616}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5429099}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.544308}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.544748}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.545556}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.545907}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.546216}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5465658}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.547452}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5477152}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.548016}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5487628}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.551253}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set 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": 1652983817.551826}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5521762}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5525818}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.552928}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5532422}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.553626}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.554229}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.554692}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.555805}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% 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": 1652983817.5562298}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5565991}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.557473}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.557759}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.558187}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.558976}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.560153}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.56048}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.560865}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.561188}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.56169}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.562591}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.564866}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.565362}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5657191}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5660212}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5663629}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.566828}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5672178}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.567887}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.568236}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.568542}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5711622}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.571472}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5720582}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5724092}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.573048}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5734751}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.574605}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.575084}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5766249}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.577609}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.578048}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.578586}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.579103}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.579693}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.579844}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.579991}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.580719}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.581037}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.581633}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.581975}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.583167}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.583319}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.583464}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5836082}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.583754}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.584055}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.584202}, "macro.dbt_utils.postgres__type_timestamp": {"unique_id": "macro.dbt_utils.postgres__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() %}\n timestamp without time zone\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5843468}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.584488}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.584788}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.584936}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.585078}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.585386}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.585542}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.585686}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.585987}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5861351}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.586275}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.586664}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5868108}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5869539}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.587889}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.588546}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.588756}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.58896}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.589988}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5903091}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.590623}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.59093}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.591305}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.591891}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5920482}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.592194}, "macro.dbt_utils.escape_single_quotes": {"unique_id": "macro.dbt_utils.escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.592911}, "macro.dbt_utils.default__escape_single_quotes": {"unique_id": "macro.dbt_utils.default__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.593183}, "macro.dbt_utils.snowflake__escape_single_quotes": {"unique_id": "macro.dbt_utils.snowflake__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.593451}, "macro.dbt_utils.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_utils.bigquery__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.593722}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.594722}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.594997}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5953019}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5956979}, "macro.dbt_utils.listagg": {"unique_id": "macro.dbt_utils.listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt_utils') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.599102}, "macro.dbt_utils.default__listagg": {"unique_id": "macro.dbt_utils.default__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.5998778}, "macro.dbt_utils.bigquery__listagg": {"unique_id": "macro.dbt_utils.bigquery__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.600418}, "macro.dbt_utils.postgres__listagg": {"unique_id": "macro.dbt_utils.postgres__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n \n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6011689}, "macro.dbt_utils.redshift__listagg": {"unique_id": "macro.dbt_utils.redshift__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "redshift__listagg", "macro_sql": "{% macro redshift__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n {% set ns = namespace() %}\n {% set ns.delimiter_text_regex = delimiter_text|trim(\"'\") %}\n {% set special_chars %}\\,^,$,.,|,?,*,+,(,),[,],{,}{% endset %} \n {%- for char in special_chars.split(',') -%}\n {% set escape_char %}\\\\{{ char }}{% endset %}\n {% set ns.delimiter_text_regex = ns.delimiter_text_regex|replace(char,escape_char) %}\n {%- endfor -%}\n\n {% set regex %}'([^{{ ns.delimiter_text_regex }}]+{{ ns.delimiter_text_regex }}){1,{{ limit_num - 1}}}[^{{ ns.delimiter_text_regex }}]+'{% endset %}\n regexp_substr(\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,{{ regex }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.602954}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6067588}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.607081}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.60739}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6106648}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) -%}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6110451}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.61181}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.612084}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6123352}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.612583}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6132312}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6135008}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.613754}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.614423}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.614698}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.614943}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6158998}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6161091}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.616312}, "macro.dbt_utils.any_value": {"unique_id": "macro.dbt_utils.any_value", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.616965}, "macro.dbt_utils.default__any_value": {"unique_id": "macro.dbt_utils.default__any_value", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n \n any_value({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.617171}, "macro.dbt_utils.postgres__any_value": {"unique_id": "macro.dbt_utils.postgres__any_value", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n {#- /*Postgres doesn't support any_value, so we're using min() to get the same result*/ -#}\n min({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6173801}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6181388}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.618408}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.618675}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.619607}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.619922}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.620928}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.621155}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.621362}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.621525}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.621834}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.622186}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.622798}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.623198}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.623575}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.626666}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.628466}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.629738}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.630145}, "macro.dbt_utils.bool_or": {"unique_id": "macro.dbt_utils.bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.630974}, "macro.dbt_utils.default__bool_or": {"unique_id": "macro.dbt_utils.default__bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n \n bool_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6312}, "macro.dbt_utils.snowflake__bool_or": {"unique_id": "macro.dbt_utils.snowflake__bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n \n boolor_agg({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.631419}, "macro.dbt_utils.bigquery__bool_or": {"unique_id": "macro.dbt_utils.bigquery__bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n \n logical_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6316311}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.632734}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6334028}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.633734}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.634754}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.635102}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.63754}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.638007}, "macro.dbt_utils._split_part_negative": {"unique_id": "macro.dbt_utils._split_part_negative", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.638453}, "macro.dbt_utils.postgres__split_part": {"unique_id": "macro.dbt_utils.postgres__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.639097}, "macro.dbt_utils.redshift__split_part": {"unique_id": "macro.dbt_utils.redshift__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "redshift__split_part", "macro_sql": "{% macro redshift__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.639746}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.640457}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6412811}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.641547}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6418078}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.643436}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.652328}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.653318}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.653919}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6548889}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}}\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6646242}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.66542}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.666317}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.667255}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1652983817.668492}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.6692128}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1652983817.669832}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.670826}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.671262}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.672072}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.6726432}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.673834}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.674484}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.675319}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.675953}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.676663}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.677005}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.678147}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.679368}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.680405}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.681144}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.6820312}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.682357}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.683079}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.6834219}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.684549}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.685788}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.686814}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1652983817.687472}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.68843}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\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": 1652983817.689003}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.6898649}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.690853}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.692058}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, previous_column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.693335}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.694227}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.694554}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.695856}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.697535}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.702167}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 }}\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": 1652983817.705017}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7056582}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7060401}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7067578}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.707138}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7077591}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7081}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.709109}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.71034}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1652983817.711516}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7119622}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n 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": 1652983817.712651}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.713359}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.714137}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.71538}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.716995}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.718401}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.71921}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.719578}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7205818}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7218728}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.723478}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.724351}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.72489}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.726061}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {% endif %}\n\n {%- for col in dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.727656}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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', 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": 1652983817.730417}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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', 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": 1652983817.7343402}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.738123}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.743477}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.744137}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.744606}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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=none, relation_alias=none) -%}\n\n {%- set error_message_group_by -%}\nWarning: the `group_by` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nUse `partition_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if kwargs.get('group_by') %}\n {%- do exceptions.warn(error_message_group_by) -%}\n {%- endif -%}\n\n {%- set error_message_order_by -%}\nWarning: `order_by` as an optional parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nSupply a non-null value for `order_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if not order_by %}\n {%- do exceptions.warn(error_message_order_by) -%}\n {%- endif -%}\n\n {%- set error_message_alias -%}\nWarning: the `relation_alias` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nIf you were using `relation_alias` to point to a CTE previously then you can now pass the alias directly to `relation` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if relation_alias %}\n {%- do exceptions.warn(error_message_alias) -%}\n {%- endif -%}\n\n {% set partition_by = partition_by or kwargs.get('group_by') %}\n {% set relation = relation_alias or relation %}\n {% set order_by = order_by or \"'1'\" %}\n\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.7485518}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.749033}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.749409}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.749773}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.750093}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.750419}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 {# 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": 1652983817.751508}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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{%- 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": 1652983817.753238}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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() -%}\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": 1652983817.754045}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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() -%}\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": 1652983817.754584}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.755711}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.756352}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.758708}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 \"table_schema\",\n table_name as \"table_name\",\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.759236}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7606778}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.761643}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.763631}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.766448}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.768254}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.769836}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.770748}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7721841}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.7729769}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.774086}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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.bigquery__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.774952}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.775119}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.775282}, "macro.dbt_utils.bigquery__get_table_types_sql": {"unique_id": "macro.dbt_utils.bigquery__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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": "bigquery__get_table_types_sql", "macro_sql": "{% macro bigquery__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as `table_type`\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.7754428}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.77708}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.7776031}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.778677}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.78052}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.788207}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.789511}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.791182}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.792567}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.793942}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.795636}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "name": "spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.796109}, "macro.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.796457}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8012118}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.813967}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.814451}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.814601}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.815732}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.818526}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.819177}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.819776}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8202891}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.820989}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8213801}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.821901}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.822765}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8242471}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.824568}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.824886}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.825202}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.825481}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.825799}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8267689}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1652983817.827708}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.829463}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.82994}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8304188}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8310552}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8315241}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8320372}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8325498}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.833235}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.833441}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.833642}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8338408}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8346639}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8358521}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.837088}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.838026}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.838291}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.838546}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.838807}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.839067}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.843303}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.843642}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.843953}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.844257}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1652983817.847508}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.848908}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.84918}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.849708}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.850252}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.850511}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8507578}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8510048}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.851939}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8530319}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.853982}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8543758}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.854806}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8554251}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_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": 1652983817.85713}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.86389}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.864557}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.865427}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.868066}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8691158}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.870143}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.870445}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.870816}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.871191}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.871487}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.871779}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.873006}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.874848}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.876044}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8764002}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.87671}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.877022}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8773289}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1652983817.8776681}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.878262}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.878552}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.878752}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.880018}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.881993}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.885268}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.887914}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.888565}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.888769}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.888968}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8899982}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1652983817.8908632}, "macro.apple_store_source.get_downloads_territory_columns": {"unique_id": "macro.apple_store_source.get_downloads_territory_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_downloads_territory_columns.sql", "original_file_path": "macros/get_downloads_territory_columns.sql", "name": "get_downloads_territory_columns", "macro_sql": "{% macro get_downloads_territory_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"first_time_downloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"redownloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"territory\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_downloads\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.892967}, "macro.apple_store_source.get_app_store_device_columns": {"unique_id": "macro.apple_store_source.get_app_store_device_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_store_device_columns.sql", "original_file_path": "macros/get_app_store_device_columns.sql", "name": "get_app_store_device_columns", "macro_sql": "{% macro get_app_store_device_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"impressions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"impressions_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"page_views\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"page_views_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.895157}, "macro.apple_store_source.get_app_store_territory_columns": {"unique_id": "macro.apple_store_source.get_app_store_territory_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_store_territory_columns.sql", "original_file_path": "macros/get_app_store_territory_columns.sql", "name": "get_app_store_territory_columns", "macro_sql": "{% macro get_app_store_territory_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"impressions_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"page_views\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"page_views_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"territory\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.8973382}, "macro.apple_store_source.get_usage_platform_version_columns": {"unique_id": "macro.apple_store_source.get_usage_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_platform_version_columns.sql", "original_file_path": "macros/get_usage_platform_version_columns.sql", "name": "get_usage_platform_version_columns", "macro_sql": "{% macro get_usage_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"platform_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.899709}, "macro.apple_store_source.get_app_store_platform_version_columns": {"unique_id": "macro.apple_store_source.get_app_store_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_store_platform_version_columns.sql", "original_file_path": "macros/get_app_store_platform_version_columns.sql", "name": "get_app_store_platform_version_columns", "macro_sql": "{% macro get_app_store_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"impressions_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"page_views\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"page_views_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"platform_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.9021828}, "macro.apple_store_source.get_downloads_platform_version_columns": {"unique_id": "macro.apple_store_source.get_downloads_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_downloads_platform_version_columns.sql", "original_file_path": "macros/get_downloads_platform_version_columns.sql", "name": "get_downloads_platform_version_columns", "macro_sql": "{% macro get_downloads_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"first_time_downloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"platform_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"redownloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_downloads\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.904203}, "macro.apple_store_source.get_sales_subscription_summary_columns": {"unique_id": "macro.apple_store_source.get_sales_subscription_summary_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_sales_subscription_summary_columns.sql", "original_file_path": "macros/get_sales_subscription_summary_columns.sql", "name": "get_sales_subscription_summary_columns", "macro_sql": "{% macro get_sales_subscription_summary_columns() %}\n\n{% set columns = [\n {\"name\": \"_filename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"_index\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_free_trial_introductory_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_pay_as_you_go_introductory_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_pay_up_front_introductory_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_standard_price_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_retry\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"developer_proceeds\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"free_trial_promotional_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"grace_period\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"marketing_opt_ins\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"pay_as_you_go_promotional_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"pay_up_front_promotional_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"proceeds_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"proceeds_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"standard_subscription_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_group_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_number\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.910313}, "macro.apple_store_source.get_crashes_platform_version_columns": {"unique_id": "macro.apple_store_source.get_crashes_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_crashes_platform_version_columns.sql", "original_file_path": "macros/get_crashes_platform_version_columns.sql", "name": "get_crashes_platform_version_columns", "macro_sql": "{% macro get_crashes_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"crashes\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"platform_version\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.912044}, "macro.apple_store_source.get_sales_subscription_events_columns": {"unique_id": "macro.apple_store_source.get_sales_subscription_events_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_sales_subscription_events_columns.sql", "original_file_path": "macros/get_sales_subscription_events_columns.sql", "name": "get_sales_subscription_events_columns", "macro_sql": "{% macro get_sales_subscription_events_columns() %}\n\n{% set columns = [\n {\"name\": \"_filename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"_index\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cancellation_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"consecutive_paid_periods\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"days_before_canceling\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"days_canceled\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"event\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"event_date\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"marketing_opt_in_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"original_start_date\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"previous_subscription_apple_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"previous_subscription_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"proceeds_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"standard_subscription_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_group_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_offer_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_offer_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_number\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.917988}, "macro.apple_store_source.get_downloads_device_columns": {"unique_id": "macro.apple_store_source.get_downloads_device_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_downloads_device_columns.sql", "original_file_path": "macros/get_downloads_device_columns.sql", "name": "get_downloads_device_columns", "macro_sql": "{% macro get_downloads_device_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_time_downloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"redownloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_downloads\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.920015}, "macro.apple_store_source.get_usage_device_columns": {"unique_id": "macro.apple_store_source.get_usage_device_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_device_columns.sql", "original_file_path": "macros/get_usage_device_columns.sql", "name": "get_usage_device_columns", "macro_sql": "{% macro get_usage_device_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.92238}, "macro.apple_store_source.get_sales_account_columns": {"unique_id": "macro.apple_store_source.get_sales_account_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_sales_account_columns.sql", "original_file_path": "macros/get_sales_account_columns.sql", "name": "get_sales_account_columns", "macro_sql": "{% macro get_sales_account_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.923415}, "macro.apple_store_source.get_date_from_string": {"unique_id": "macro.apple_store_source.get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "get_date_from_string", "macro_sql": "{% macro get_date_from_string(string_text) %}\n {{ return(adapter.dispatch('get_date_from_string') (string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.apple_store_source.bigquery__get_date_from_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.924128}, "macro.apple_store_source.default__get_date_from_string": {"unique_id": "macro.apple_store_source.default__get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "default__get_date_from_string", "macro_sql": "{% macro default__get_date_from_string(string_text) %}\n\n to_date(\n {{ string_text }}, \n 'YYYYMMDD'\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.9243379}, "macro.apple_store_source.bigquery__get_date_from_string": {"unique_id": "macro.apple_store_source.bigquery__get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "bigquery__get_date_from_string", "macro_sql": "{% macro bigquery__get_date_from_string(string_text) %}\n\n parse_date(\n '%Y%m%d',\n {{ string_text }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.924543}, "macro.apple_store_source.spark__get_date_from_string": {"unique_id": "macro.apple_store_source.spark__get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "spark__get_date_from_string", "macro_sql": "{% macro spark__get_date_from_string(string_text) %}\n\n to_date(\n {{ string_text }},\n 'yyyyMMdd'\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.9247448}, "macro.apple_store_source.get_crashes_app_version_columns": {"unique_id": "macro.apple_store_source.get_crashes_app_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_crashes_app_version_columns.sql", "original_file_path": "macros/get_crashes_app_version_columns.sql", "name": "get_crashes_app_version_columns", "macro_sql": "{% macro get_crashes_app_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"crashes\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"}\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": 1652983817.9264169}, "macro.apple_store_source.get_usage_territory_columns": {"unique_id": "macro.apple_store_source.get_usage_territory_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_territory_columns.sql", "original_file_path": "macros/get_usage_territory_columns.sql", "name": "get_usage_territory_columns", "macro_sql": "{% macro get_usage_territory_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"territory\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.9287732}, "macro.apple_store_source.get_usage_app_version_columns": {"unique_id": "macro.apple_store_source.get_usage_app_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_app_version_columns.sql", "original_file_path": "macros/get_usage_app_version_columns.sql", "name": "get_usage_app_version_columns", "macro_sql": "{% macro get_usage_app_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1652983817.9311528}, "macro.apple_store_source.get_app_columns": {"unique_id": "macro.apple_store_source.get_app_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_columns.sql", "original_file_path": "macros/get_app_columns.sql", "name": "get_app_columns", "macro_sql": "{% macro get_app_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_opt_in_rate\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"asset_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"icon_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ios\", \"datatype\": \"boolean\"},\n {\"name\": \"is_bundle\", \"datatype\": \"boolean\"},\n {\"name\": \"is_enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pre_order_info\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tvos\", \"datatype\": \"boolean\"}\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": 1652983817.93343}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "apple_store_source._fivetran_synced": {"unique_id": "apple_store_source._fivetran_synced", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "_fivetran_synced", "block_contents": "Timestamp of when Fivetran synced a record."}, "apple_store_source.account_id": {"unique_id": "apple_store_source.account_id", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "account_id", "block_contents": "Sales Account ID associated with the app name or app ID."}, "apple_store_source.account_name": {"unique_id": "apple_store_source.account_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "account_name", "block_contents": "Sales Account Name associated with the Sales Account ID, app name or app ID."}, "apple_store_source.active_devices": {"unique_id": "apple_store_source.active_devices", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_devices", "block_contents": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day."}, "apple_store_source.active_devices_last_30_days": {"unique_id": "apple_store_source.active_devices_last_30_days", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_devices_last_30_days", "block_contents": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day."}, "apple_store_source.active_free_trial_introductory_offer_subscriptions": {"unique_id": "apple_store_source.active_free_trial_introductory_offer_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_free_trial_introductory_offer_subscriptions", "block_contents": "Total number of introductory offer subscriptions currently in a free trial."}, "apple_store_source.active_pay_as_you_go_introductory_offer_subscriptions": {"unique_id": "apple_store_source.active_pay_as_you_go_introductory_offer_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_pay_as_you_go_introductory_offer_subscriptions", "block_contents": "Total number of introductory offer subscriptions currently with a pay as you go introductory price."}, "apple_store_source.active_pay_up_front_introductory_offer_subscriptions": {"unique_id": "apple_store_source.active_pay_up_front_introductory_offer_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_pay_up_front_introductory_offer_subscriptions", "block_contents": "Total number of introductory offer subscriptions currently with a pay up front introductory price."}, "apple_store_source.active_standard_price_subscriptions": {"unique_id": "apple_store_source.active_standard_price_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_standard_price_subscriptions", "block_contents": "Total number of auto-renewable standard paid subscriptions currently active, excluding free trials, \nsubscription offers, introductory offers, and marketing opt-ins. Subscriptions are active during the period for which the customer has paid without cancellation."}, "apple_store_source.alternative_country_name": {"unique_id": "apple_store_source.alternative_country_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "alternative_country_name", "block_contents": "Due to differences in the official ISO country names and Apple's naming convention, we've added an alternative territory name that will allow us to join reports and infer ISO fields."}, "apple_store_source.app_id": {"unique_id": "apple_store_source.app_id", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "app_id", "block_contents": "Application ID."}, "apple_store_source.app_name": {"unique_id": "apple_store_source.app_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "app_name", "block_contents": "Application Name."}, "apple_store_source.app_version": {"unique_id": "apple_store_source.app_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "app_version", "block_contents": "The app version of the app that the user is engaging with."}, "apple_store_source.country": {"unique_id": "apple_store_source.country", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country", "block_contents": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2."}, "apple_store_source.country_code_alpha_2": {"unique_id": "apple_store_source.country_code_alpha_2", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_code_alpha_2", "block_contents": "The 2 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.country_code_alpha_3": {"unique_id": "apple_store_source.country_code_alpha_3", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_code_alpha_3", "block_contents": "The 3 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.country_code_numeric": {"unique_id": "apple_store_source.country_code_numeric", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_code_numeric", "block_contents": "The 3 digit ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.country_name": {"unique_id": "apple_store_source.country_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_name", "block_contents": "The ISO-3166 English country name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.crashes": {"unique_id": "apple_store_source.crashes", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "crashes", "block_contents": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day."}, "apple_store_source.date_day": {"unique_id": "apple_store_source.date_day", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "date_day", "block_contents": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`."}, "apple_store_source.deletions": {"unique_id": "apple_store_source.deletions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "deletions", "block_contents": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day."}, "apple_store_source.device": {"unique_id": "apple_store_source.device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "device", "block_contents": "Device type associated with the respective metric(s)."}, "apple_store_source.event": {"unique_id": "apple_store_source.event", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "event", "block_contents": "The subscription event associated with the respective metric(s)."}, "apple_store_source.first_time_downloads": {"unique_id": "apple_store_source.first_time_downloads", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "first_time_downloads", "block_contents": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download."}, "apple_store_source.impressions": {"unique_id": "apple_store_source.impressions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "impressions", "block_contents": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))"}, "apple_store_source.impressions_unique_device": {"unique_id": "apple_store_source.impressions_unique_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "impressions_unique_device", "block_contents": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI."}, "apple_store_source.installations": {"unique_id": "apple_store_source.installations", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "installations", "block_contents": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day."}, "apple_store_source.page_views": {"unique_id": "apple_store_source.page_views", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "page_views", "block_contents": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))"}, "apple_store_source.page_views_unique_device": {"unique_id": "apple_store_source.page_views_unique_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "page_views_unique_device", "block_contents": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI."}, "apple_store_source.platform_version": {"unique_id": "apple_store_source.platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "platform_version", "block_contents": "The platform version of the device engaging with your app."}, "apple_store_source.quantity": {"unique_id": "apple_store_source.quantity", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "quantity", "block_contents": "The number of occurrences of a given subscription event."}, "apple_store_source.sessions": {"unique_id": "apple_store_source.sessions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "sessions", "block_contents": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day."}, "apple_store_source.redownloads": {"unique_id": "apple_store_source.redownloads", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "redownloads", "block_contents": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day."}, "apple_store_source.region": {"unique_id": "apple_store_source.region", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "region", "block_contents": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.region_code": {"unique_id": "apple_store_source.region_code", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "region_code", "block_contents": "The UN Statistics region numerical code assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.source_type": {"unique_id": "apple_store_source.source_type", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "source_type", "block_contents": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary."}, "apple_store_source.state": {"unique_id": "apple_store_source.state", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "state", "block_contents": "The state associated with the subscription event metrics or subscription summary metrics."}, "apple_store_source.sub_region": {"unique_id": "apple_store_source.sub_region", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "sub_region", "block_contents": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.sub_region_code": {"unique_id": "apple_store_source.sub_region_code", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "sub_region_code", "block_contents": "The UN Statistics sub-region numerical code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.subscription_name": {"unique_id": "apple_store_source.subscription_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "subscription_name", "block_contents": "The subscription name associated with the subscription event metric or subscription summary metric."}, "apple_store_source.territory": {"unique_id": "apple_store_source.territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "territory", "block_contents": "The territory (aka country) full name associated with the report's respective metric(s)."}, "apple_store_source.total_downloads": {"unique_id": "apple_store_source.total_downloads", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "total_downloads", "block_contents": "Total Downloads is the sum of Redownloads and First Time Downloads."}, "apple_store.territory_long": {"unique_id": "apple_store.territory_long", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "docs.md", "original_file_path": "models/docs.md", "name": "territory_long", "block_contents": "The territory (aka country) full name associated with the report's respective metric(s). Territory_long uses source territories for the following: downloads, usage and app store; territory_long is inferred from ISO-3166 using the 2-character country code for subscription events and subscription summary. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store.territory_short": {"unique_id": "apple_store.territory_short", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "docs.md", "original_file_path": "models/docs.md", "name": "territory_short", "block_contents": "The 2-character country code associated with the report's respective metric(s). Territory_short uses source 2-character country codes for the subscription events and subscription summary; territory_short is inferred from ISO-3166 using source territories for the following: downloads, usage and app store. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {"model.apple_store_source.stg_apple_store__sales_subscription_events": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_apple_store__sales_subscription_events_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_apple_store__sales_subscription_events_tmp')),\n staging_columns=get_sales_subscription_events_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n event_date as date_day, \n account_number as account_id,\n app_name,\n subscription_name,\n event,\n country,\n case\n when replace(state, ' ', '') = '' then cast(null as {{ dbt_utils.type_string() }}) else state\n end as state,\n case \n when lower(device) like 'ipod%' then 'iPod' else device\n end as device,\n sum(quantity) as quantity\n from fields\n {{ dbt_utils.group_by(8) }}\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_sales_subscription_events_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__sales_subscription_events"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_events", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__sales_subscription_events.sql", "original_file_path": "models/stg_apple_store__sales_subscription_events.sql", "name": "stg_apple_store__sales_subscription_events", "alias": "stg_apple_store__sales_subscription_events", "checksum": {"name": "sha256", "checksum": "46952b852ca9e3c3e108f9b699dda71c3acf574c59b068b1d41a1bb4662cac87"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_events_tmp"], ["stg_apple_store__sales_subscription_events_tmp"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source", "enabled": false}, "created_at": 1652983818.540561}], "model.apple_store_source.stg_apple_store__sales_subscription_summary": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_apple_store__sales_subscription_summary_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_apple_store__sales_subscription_summary_tmp')),\n staging_columns=get_sales_subscription_summary_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n {{ get_date_from_string( dbt_utils.split_part(string_text='_filename', delimiter_text=\"'_'\", part_number=3) ) }} as date_day, \n app_name,\n account_number as account_id,\n country,\n case\n when replace(state, ' ', '') = '' then cast(null as {{ dbt_utils.type_string() }}) else state\n end as state,\n subscription_name,\n case \n when lower(device) like 'ipod%' then 'iPod' else device\n end as device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from fields\n {{ dbt_utils.group_by(7) }}\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_sales_subscription_summary_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.split_part", "macro.apple_store_source.get_date_from_string", "macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__sales_subscription_summary"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_summary", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__sales_subscription_summary.sql", "original_file_path": "models/stg_apple_store__sales_subscription_summary.sql", "name": "stg_apple_store__sales_subscription_summary", "alias": "stg_apple_store__sales_subscription_summary", "checksum": {"name": "sha256", "checksum": "f7af9dcbea1ffb5854b85069bdc191ec30f30fa41ed05140d656ab8c154a1855"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_summary_tmp"], ["stg_apple_store__sales_subscription_summary_tmp"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source", "enabled": false}, "created_at": 1652983818.577595}], "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nselect * from {{ var('sales_subscription_events') }}", "resource_type": "model", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__sales_subscription_events_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__sales_subscription_events_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__sales_subscription_events_tmp.sql", "name": "stg_apple_store__sales_subscription_events_tmp", "alias": "stg_apple_store__sales_subscription_events_tmp", "checksum": {"name": "sha256", "checksum": "edb7951fef9c69fab3abfb462b5dc936c613ba302a58cbee7b1b8db96b987e53"}, "tags": [], "refs": [["sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source", "enabled": false}, "created_at": 1652983818.667754}], "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nselect * from {{ var('sales_subscription_summary') }}", "resource_type": "model", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__sales_subscription_summary_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__sales_subscription_summary_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__sales_subscription_summary_tmp.sql", "name": "stg_apple_store__sales_subscription_summary_tmp", "alias": "stg_apple_store__sales_subscription_summary_tmp", "checksum": {"name": "sha256", "checksum": "1383d8993ec8b6196d7ff43020f3263626874458e65ea1114c6c34c77a7d14df"}, "tags": [], "refs": [["sales_subscription_summary"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source", "enabled": false}, "created_at": 1652983818.711872}], "model.apple_store.apple_store__subscription_report": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith subscription_summary as (\n\n select *\n from {{ ref('int_apple_store__sales_subscription_summary') }}\n),\n\nsubscription_events as (\n\n select *\n from {{ ref('int_apple_store__sales_subscription_events') }}\n),\n\ncountry_codes as (\n \n select * \n from {{ var('apple_store_country_codes') }}\n),\n\nreporting_grain_combined as (\n\n select\n cast(date_day as date) as date_day,\n account_id,\n account_name,\n app_name,\n app_id,\n subscription_name,\n country,\n state \n from subscription_summary\n union all\n select\n cast(date_day as date) as date_day,\n account_id,\n account_name,\n app_name,\n app_id,\n subscription_name,\n country,\n state \n from subscription_events\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.account_id,\n reporting_grain.account_name, \n reporting_grain.app_id,\n reporting_grain.app_name,\n reporting_grain.subscription_name, \n case \n when country_codes.alternative_country_name is null then country_codes.country_name\n else country_codes.alternative_country_name\n end as territory_long,\n reporting_grain.country as territory_short,\n reporting_grain.state,\n country_codes.region, \n country_codes.sub_region,\n coalesce(subscription_summary.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_as_you_go_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce({{ 'subscription_events.' ~ event_column }}, 0)\n as {{ event_column }} \n {% endfor %}\n from reporting_grain\n left join subscription_summary\n on reporting_grain.date_day = subscription_summary.date_day\n and reporting_grain.account_id = subscription_summary.account_id \n and reporting_grain.app_name = subscription_summary.app_name\n and reporting_grain.subscription_name = subscription_summary.subscription_name\n and reporting_grain.country = subscription_summary.country\n and reporting_grain.state = subscription_summary.state\n left join subscription_events\n on reporting_grain.date_day = subscription_events.date_day\n and reporting_grain.account_id = subscription_events.account_id \n and reporting_grain.app_name = subscription_events.app_name\n and reporting_grain.subscription_name = subscription_events.subscription_name\n and reporting_grain.country = subscription_events.country\n and reporting_grain.state = subscription_events.state\n left join country_codes\n on reporting_grain.country = country_codes.country_code_alpha_2\n \n)\n\nselect * from joined", "resource_type": "model", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__subscription_report"], "unique_id": "model.apple_store.apple_store__subscription_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__subscription_report.sql", "original_file_path": "models/apple_store__subscription_report.sql", "name": "apple_store__subscription_report", "alias": "apple_store__subscription_report", "checksum": {"name": "sha256", "checksum": "8be8d403e589b5b9950485bac2349deadbc8d8493a1f386d594bab4689a4a87d"}, "tags": [], "refs": [["int_apple_store__sales_subscription_summary"], ["int_apple_store__sales_subscription_events"], ["apple_store_country_codes"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store", "enabled": false}, "created_at": 1652983818.7682712}], "model.apple_store.int_apple_store__sales_subscription_overview": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith subscription_summary as (\n\n select\n date_day,\n app_id,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from {{ ref('int_apple_store__sales_subscription_summary') }}\n {{ dbt_utils.group_by(2) }}\n), \n\nsubscription_events as (\n\n select \n date_day,\n app_id\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce(sum({{event_column }}), 0)\n as {{ event_column }} \n {% endfor %}\n from {{ ref('int_apple_store__sales_subscription_events') }}\n {{ dbt_utils.group_by(2) }}\n), \n\njoined as (\n\n select \n subscription_events.*,\n active_free_trial_introductory_offer_subscriptions,\n active_pay_as_you_go_introductory_offer_subscriptions,\n active_pay_up_front_introductory_offer_subscriptions,\n active_standard_price_subscriptions\n from subscription_summary \n left join subscription_events\n on subscription_summary.date_day = subscription_events.date_day\n and subscription_summary.app_id = subscription_events.app_id \n)\n\nselect * from joined", "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__sales_subscription_overview"], "unique_id": "model.apple_store.int_apple_store__sales_subscription_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__sales_subscription_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql", "name": "int_apple_store__sales_subscription_overview", "alias": "int_apple_store__sales_subscription_overview", "checksum": {"name": "sha256", "checksum": "ade05deb6a33d344cb526a417bc1c0298fae7fdcacf9b3a7c3ec32738b7ff3c8"}, "tags": [], "refs": [["int_apple_store__sales_subscription_summary"], ["int_apple_store__sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": false}, "created_at": 1652983818.879085}], "model.apple_store.int_apple_store__sales_subscription_events": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select *\n from {{ var('sales_subscription_events') }}\n),\n\napp as (\n \n select *\n from {{ var('app') }}\n),\n\nsales_account as (\n \n select * \n from {{ var('sales_account') }}\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n {% for event_val in var('apple_store__subscription_events') %}\n {% if loop.index0 != 0 %}\n , \n {% endif %}\n '{{ var(\"apple_store__subscription_events\")[loop.index0] | trim | lower }}'\n {% endfor %} \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n {% for event_val in var('apple_store__subscription_events') %}\n , sum(case when lower(event) = '{{ event_val | trim | lower }}' then quantity else 0 end) as {{ 'event_' ~ event_val | replace(' ', '_') | trim | lower }}\n {% endfor %}\n from filtered\n {{ dbt_utils.group_by(6) }}\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n {% for event_val in var('apple_store__subscription_events') %}\n , pivoted.{{ 'event_' ~ event_val | replace(' ', '_') | trim | lower }}\n {% endfor %}\n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * from joined", "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "subscription_report", "int_apple_store__sales_subscription_events"], "unique_id": "model.apple_store.int_apple_store__sales_subscription_events", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/subscription_report/int_apple_store__sales_subscription_events.sql", "original_file_path": "models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql", "name": "int_apple_store__sales_subscription_events", "alias": "int_apple_store__sales_subscription_events", "checksum": {"name": "sha256", "checksum": "7eee63db253b0ce6ab84e3c2ba4489840caccf79b151720d9d38c7c79847cd79"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_events"], ["stg_apple_store__app"], ["stg_apple_store__sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": false}, "created_at": 1652983818.913357}], "model.apple_store.int_apple_store__sales_subscription_summary": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select *\n from {{ var('sales_subscription_summary') }}\n),\n\napp as (\n \n select *\n from {{ var('app') }}\n),\n\nsales_account as (\n \n select * \n from {{ var('sales_account') }}\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n {{ dbt_utils.group_by(8) }}\n)\n\nselect * from joined", "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "subscription_report", "int_apple_store__sales_subscription_summary"], "unique_id": "model.apple_store.int_apple_store__sales_subscription_summary", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql", "original_file_path": "models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql", "name": "int_apple_store__sales_subscription_summary", "alias": "int_apple_store__sales_subscription_summary", "checksum": {"name": "sha256", "checksum": "d0dbd21d542fd37a1ad8cee511df9f0e1d1f536ff620667aa9dcb6479b3b727a"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_summary"], ["stg_apple_store__app"], ["stg_apple_store__sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": false}, "created_at": 1652983818.924879}], "model.apple_store.int_apple_store__subscription_device": [{"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith app as (\n \n select *\n from {{ var('app') }}\n),\n\nsubscription_summary as (\n\n select\n date_day,\n app_name,\n device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from {{ var('sales_subscription_summary') }}\n {{ dbt_utils.group_by(3) }}\n), \n\nfiltered_subscription_events as (\n\n select *\n from {{ var('sales_subscription_events') }} \n where lower(event)\n in (\n {% for event_val in var('apple_store__subscription_events') %}\n {% if loop.index0 != 0 %}\n , \n {% endif %}\n '{{ var(\"apple_store__subscription_events\")[loop.index0] | trim | lower }}'\n {% endfor %} \n )\n),\n\npivoted_subscription_events as (\n \n select\n date_day\n , app_name\n , device\n {% for event_val in var('apple_store__subscription_events') %}\n , sum(case when lower(event) = '{{ event_val | trim | lower }}' then quantity else 0 end) as {{ 'event_' ~ event_val | replace(' ', '_') | trim | lower }}\n {% endfor %}\n from filtered_subscription_events\n {{ dbt_utils.group_by(3) }}\n),\n\njoined as (\n\n select \n app.app_id,\n pivoted_subscription_events.*,\n subscription_summary.active_free_trial_introductory_offer_subscriptions,\n subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions,\n subscription_summary.active_pay_up_front_introductory_offer_subscriptions,\n subscription_summary.active_standard_price_subscriptions,\n cast(null as {{ dbt_utils.type_string() }}) as source_type\n from subscription_summary \n left join pivoted_subscription_events\n on subscription_summary.date_day = pivoted_subscription_events.date_day\n and subscription_summary.app_name = pivoted_subscription_events.app_name\n and subscription_summary.device = pivoted_subscription_events.device\n left join app \n on subscription_summary.app_name = app.app_name\n \n)\n\nselect * from joined", "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.type_string"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "device_report", "int_apple_store__subscription_device"], "unique_id": "model.apple_store.int_apple_store__subscription_device", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/device_report/int_apple_store__subscription_device.sql", "original_file_path": "models/intermediate/device_report/int_apple_store__subscription_device.sql", "name": "int_apple_store__subscription_device", "alias": "int_apple_store__subscription_device", "checksum": {"name": "sha256", "checksum": "7eee807b010b0e0b04dfa1aca56b857f9a55929b1369db968d7ce04b11a1a3ca"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__sales_subscription_summary"], ["stg_apple_store__sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": false}, "created_at": 1652983818.9316611}]}, "parent_map": {"seed.apple_store_integration_tests.sales_account": [], "seed.apple_store_integration_tests.sales_subscription_summary": [], "seed.apple_store_integration_tests.downloads_source_type_device": [], "seed.apple_store_integration_tests.crashes_platform_version": [], "seed.apple_store_integration_tests.usage_app_version_source_type": [], "seed.apple_store_integration_tests.sales_subscription_events": [], "seed.apple_store_integration_tests.crashes_app_version": [], "seed.apple_store_integration_tests.downloads_territory_source_type": [], "seed.apple_store_integration_tests.usage_territory_source_type": [], "seed.apple_store_integration_tests.usage_source_type_device": [], "seed.apple_store_integration_tests.app_store_territory_source_type": [], "seed.apple_store_integration_tests.app_store_platform_version_source_type": [], "seed.apple_store_integration_tests.usage_platform_version_source_type": [], "seed.apple_store_integration_tests.downloads_platform_version_source_type": [], "seed.apple_store_integration_tests.app": [], "seed.apple_store_integration_tests.app_store_source_type_device": [], "model.apple_store_source.stg_apple_store__crashes_app_version": ["model.apple_store_source.stg_apple_store__crashes_app_version_tmp", "model.apple_store_source.stg_apple_store__crashes_app_version_tmp"], "model.apple_store_source.stg_apple_store__sales_account": ["model.apple_store_source.stg_apple_store__sales_account_tmp", "model.apple_store_source.stg_apple_store__sales_account_tmp"], "model.apple_store_source.stg_apple_store__usage_app_version": ["model.apple_store_source.stg_apple_store__usage_app_version_tmp", "model.apple_store_source.stg_apple_store__usage_app_version_tmp"], "model.apple_store_source.stg_apple_store__app_store_platform_version": ["model.apple_store_source.stg_apple_store__app_store_platform_version_tmp", "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"], "model.apple_store_source.stg_apple_store__app_store_territory": ["model.apple_store_source.stg_apple_store__app_store_territory_tmp", "model.apple_store_source.stg_apple_store__app_store_territory_tmp"], "model.apple_store_source.stg_apple_store__app_store_device": ["model.apple_store_source.stg_apple_store__app_store_device_tmp", "model.apple_store_source.stg_apple_store__app_store_device_tmp"], "model.apple_store_source.stg_apple_store__usage_device": ["model.apple_store_source.stg_apple_store__usage_device_tmp", "model.apple_store_source.stg_apple_store__usage_device_tmp"], "model.apple_store_source.stg_apple_store__downloads_device": ["model.apple_store_source.stg_apple_store__downloads_device_tmp", "model.apple_store_source.stg_apple_store__downloads_device_tmp"], "model.apple_store_source.stg_apple_store__usage_territory": ["model.apple_store_source.stg_apple_store__usage_territory_tmp", "model.apple_store_source.stg_apple_store__usage_territory_tmp"], "model.apple_store_source.stg_apple_store__crashes_platform_version": ["model.apple_store_source.stg_apple_store__crashes_platform_version_tmp", "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"], "model.apple_store_source.stg_apple_store__app": ["model.apple_store_source.stg_apple_store__app_tmp", "model.apple_store_source.stg_apple_store__app_tmp"], "model.apple_store_source.stg_apple_store__downloads_platform_version": ["model.apple_store_source.stg_apple_store__downloads_platform_version_tmp", "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"], "model.apple_store_source.stg_apple_store__usage_platform_version": ["model.apple_store_source.stg_apple_store__usage_platform_version_tmp", "model.apple_store_source.stg_apple_store__usage_platform_version_tmp"], "model.apple_store_source.stg_apple_store__downloads_territory": ["model.apple_store_source.stg_apple_store__downloads_territory_tmp", "model.apple_store_source.stg_apple_store__downloads_territory_tmp"], "model.apple_store_source.stg_apple_store__app_tmp": ["seed.apple_store_integration_tests.app"], "model.apple_store_source.stg_apple_store__usage_platform_version_tmp": ["seed.apple_store_integration_tests.usage_platform_version_source_type"], "model.apple_store_source.stg_apple_store__app_store_territory_tmp": ["seed.apple_store_integration_tests.app_store_territory_source_type"], "model.apple_store_source.stg_apple_store__downloads_territory_tmp": ["seed.apple_store_integration_tests.downloads_territory_source_type"], "model.apple_store_source.stg_apple_store__sales_account_tmp": ["seed.apple_store_integration_tests.sales_account"], "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp": ["seed.apple_store_integration_tests.downloads_platform_version_source_type"], "model.apple_store_source.stg_apple_store__usage_territory_tmp": ["seed.apple_store_integration_tests.usage_territory_source_type"], "model.apple_store_source.stg_apple_store__crashes_app_version_tmp": ["seed.apple_store_integration_tests.crashes_app_version"], "model.apple_store_source.stg_apple_store__downloads_device_tmp": ["seed.apple_store_integration_tests.downloads_source_type_device"], "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp": ["seed.apple_store_integration_tests.crashes_platform_version"], "model.apple_store_source.stg_apple_store__app_store_device_tmp": ["seed.apple_store_integration_tests.app_store_source_type_device"], "model.apple_store_source.stg_apple_store__usage_app_version_tmp": ["seed.apple_store_integration_tests.usage_app_version_source_type"], "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp": ["seed.apple_store_integration_tests.app_store_platform_version_source_type"], "model.apple_store_source.stg_apple_store__usage_device_tmp": ["seed.apple_store_integration_tests.usage_source_type_device"], "seed.apple_store_source.apple_store_country_codes": [], "model.apple_store.apple_store__source_type_report": ["model.apple_store.int_apple_store__app_store_source_type", "model.apple_store.int_apple_store__downloads_source_type", "model.apple_store.int_apple_store__usage_source_type", "model.apple_store_source.stg_apple_store__app"], "model.apple_store.apple_store__platform_version_report": ["model.apple_store.int_apple_store__platform_version", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_platform_version", "model.apple_store_source.stg_apple_store__downloads_platform_version", "model.apple_store_source.stg_apple_store__usage_platform_version"], "model.apple_store.apple_store__territory_report": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_territory", "model.apple_store_source.stg_apple_store__downloads_territory", "model.apple_store_source.stg_apple_store__usage_territory", "seed.apple_store_source.apple_store_country_codes"], "model.apple_store.apple_store__device_report": ["model.apple_store.int_apple_store__crashes_device", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_device", "model.apple_store_source.stg_apple_store__downloads_device", "model.apple_store_source.stg_apple_store__usage_device"], "model.apple_store.apple_store__app_version_report": ["model.apple_store.int_apple_store__crashes_app_version", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__usage_app_version"], "model.apple_store.apple_store__overview_report": ["model.apple_store.int_apple_store__app_store_overview", "model.apple_store.int_apple_store__crashes_overview", "model.apple_store.int_apple_store__downloads_overview", "model.apple_store.int_apple_store__usage_overview", "model.apple_store_source.stg_apple_store__app"], "model.apple_store.int_apple_store__app_store_source_type": ["model.apple_store_source.stg_apple_store__app_store_device"], "model.apple_store.int_apple_store__downloads_source_type": ["model.apple_store_source.stg_apple_store__downloads_device"], "model.apple_store.int_apple_store__usage_source_type": ["model.apple_store_source.stg_apple_store__usage_device"], "model.apple_store.int_apple_store__usage_overview": ["model.apple_store_source.stg_apple_store__usage_device"], "model.apple_store.int_apple_store__downloads_overview": ["model.apple_store_source.stg_apple_store__downloads_device"], "model.apple_store.int_apple_store__crashes_overview": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "model.apple_store.int_apple_store__app_store_overview": ["model.apple_store_source.stg_apple_store__app_store_device"], "model.apple_store.int_apple_store__platform_version": ["model.apple_store_source.stg_apple_store__crashes_platform_version"], "model.apple_store.int_apple_store__crashes_app_version": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "model.apple_store.int_apple_store__crashes_device": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa": ["model.apple_store_source.stg_apple_store__app"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067": ["model.apple_store_source.stg_apple_store__app_store_device"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a": ["model.apple_store_source.stg_apple_store__app_store_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f": ["model.apple_store_source.stg_apple_store__app_store_territory"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3": ["model.apple_store_source.stg_apple_store__crashes_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2": ["model.apple_store_source.stg_apple_store__downloads_device"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc": ["model.apple_store_source.stg_apple_store__downloads_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6": ["model.apple_store_source.stg_apple_store__downloads_territory"], "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8": ["model.apple_store_source.stg_apple_store__sales_account"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2": ["model.apple_store_source.stg_apple_store__usage_app_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145": ["model.apple_store_source.stg_apple_store__usage_device"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6": ["model.apple_store_source.stg_apple_store__usage_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939": ["model.apple_store_source.stg_apple_store__usage_territory"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6": ["model.apple_store.apple_store__territory_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996": ["model.apple_store.apple_store__device_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092": ["model.apple_store.apple_store__source_type_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968": ["model.apple_store.apple_store__overview_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68": ["model.apple_store.apple_store__platform_version_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca": ["model.apple_store.apple_store__app_version_report"], "source.apple_store_source.apple_store.app": [], "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": [], "source.apple_store_source.apple_store.app_store_source_type_device_report": [], "source.apple_store_source.apple_store.app_store_territory_source_type_report": [], "source.apple_store_source.apple_store.crashes_app_version_device_report": [], "source.apple_store_source.apple_store.crashes_platform_version_device_report": [], "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": [], "source.apple_store_source.apple_store.downloads_source_type_device_report": [], "source.apple_store_source.apple_store.downloads_territory_source_type_report": [], "source.apple_store_source.apple_store.sales_account": [], "source.apple_store_source.apple_store.sales_subscription_event_summary": [], "source.apple_store_source.apple_store.sales_subscription_summary": [], "source.apple_store_source.apple_store.usage_app_version_source_type_report": [], "source.apple_store_source.apple_store.usage_platform_version_source_type_report": [], "source.apple_store_source.apple_store.usage_source_type_device_report": [], "source.apple_store_source.apple_store.usage_territory_source_type_report": []}, "child_map": {"seed.apple_store_integration_tests.sales_account": ["model.apple_store_source.stg_apple_store__sales_account_tmp"], "seed.apple_store_integration_tests.sales_subscription_summary": [], "seed.apple_store_integration_tests.downloads_source_type_device": ["model.apple_store_source.stg_apple_store__downloads_device_tmp"], "seed.apple_store_integration_tests.crashes_platform_version": ["model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"], "seed.apple_store_integration_tests.usage_app_version_source_type": ["model.apple_store_source.stg_apple_store__usage_app_version_tmp"], "seed.apple_store_integration_tests.sales_subscription_events": [], "seed.apple_store_integration_tests.crashes_app_version": ["model.apple_store_source.stg_apple_store__crashes_app_version_tmp"], "seed.apple_store_integration_tests.downloads_territory_source_type": ["model.apple_store_source.stg_apple_store__downloads_territory_tmp"], "seed.apple_store_integration_tests.usage_territory_source_type": ["model.apple_store_source.stg_apple_store__usage_territory_tmp"], "seed.apple_store_integration_tests.usage_source_type_device": ["model.apple_store_source.stg_apple_store__usage_device_tmp"], "seed.apple_store_integration_tests.app_store_territory_source_type": ["model.apple_store_source.stg_apple_store__app_store_territory_tmp"], "seed.apple_store_integration_tests.app_store_platform_version_source_type": ["model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"], "seed.apple_store_integration_tests.usage_platform_version_source_type": ["model.apple_store_source.stg_apple_store__usage_platform_version_tmp"], "seed.apple_store_integration_tests.downloads_platform_version_source_type": ["model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"], "seed.apple_store_integration_tests.app": ["model.apple_store_source.stg_apple_store__app_tmp"], "seed.apple_store_integration_tests.app_store_source_type_device": ["model.apple_store_source.stg_apple_store__app_store_device_tmp"], "model.apple_store_source.stg_apple_store__crashes_app_version": ["model.apple_store.int_apple_store__crashes_app_version", "model.apple_store.int_apple_store__crashes_device", "model.apple_store.int_apple_store__crashes_overview", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75"], "model.apple_store_source.stg_apple_store__sales_account": ["test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8"], "model.apple_store_source.stg_apple_store__usage_app_version": ["model.apple_store.apple_store__app_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2"], "model.apple_store_source.stg_apple_store__app_store_platform_version": ["model.apple_store.apple_store__platform_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a"], "model.apple_store_source.stg_apple_store__app_store_territory": ["model.apple_store.apple_store__territory_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f"], "model.apple_store_source.stg_apple_store__app_store_device": ["model.apple_store.apple_store__device_report", "model.apple_store.int_apple_store__app_store_overview", "model.apple_store.int_apple_store__app_store_source_type", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067"], "model.apple_store_source.stg_apple_store__usage_device": ["model.apple_store.apple_store__device_report", "model.apple_store.int_apple_store__usage_overview", "model.apple_store.int_apple_store__usage_source_type", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145"], "model.apple_store_source.stg_apple_store__downloads_device": ["model.apple_store.apple_store__device_report", "model.apple_store.int_apple_store__downloads_overview", "model.apple_store.int_apple_store__downloads_source_type", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2"], "model.apple_store_source.stg_apple_store__usage_territory": ["model.apple_store.apple_store__territory_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939"], "model.apple_store_source.stg_apple_store__crashes_platform_version": ["model.apple_store.int_apple_store__platform_version", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3"], "model.apple_store_source.stg_apple_store__app": ["model.apple_store.apple_store__app_version_report", "model.apple_store.apple_store__device_report", "model.apple_store.apple_store__overview_report", "model.apple_store.apple_store__platform_version_report", "model.apple_store.apple_store__source_type_report", "model.apple_store.apple_store__territory_report", "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa"], "model.apple_store_source.stg_apple_store__downloads_platform_version": ["model.apple_store.apple_store__platform_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc"], "model.apple_store_source.stg_apple_store__usage_platform_version": ["model.apple_store.apple_store__platform_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6"], "model.apple_store_source.stg_apple_store__downloads_territory": ["model.apple_store.apple_store__territory_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6"], "model.apple_store_source.stg_apple_store__app_tmp": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app"], "model.apple_store_source.stg_apple_store__usage_platform_version_tmp": ["model.apple_store_source.stg_apple_store__usage_platform_version", "model.apple_store_source.stg_apple_store__usage_platform_version"], "model.apple_store_source.stg_apple_store__app_store_territory_tmp": ["model.apple_store_source.stg_apple_store__app_store_territory", "model.apple_store_source.stg_apple_store__app_store_territory"], "model.apple_store_source.stg_apple_store__downloads_territory_tmp": ["model.apple_store_source.stg_apple_store__downloads_territory", "model.apple_store_source.stg_apple_store__downloads_territory"], "model.apple_store_source.stg_apple_store__sales_account_tmp": ["model.apple_store_source.stg_apple_store__sales_account", "model.apple_store_source.stg_apple_store__sales_account"], "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp": ["model.apple_store_source.stg_apple_store__downloads_platform_version", "model.apple_store_source.stg_apple_store__downloads_platform_version"], "model.apple_store_source.stg_apple_store__usage_territory_tmp": ["model.apple_store_source.stg_apple_store__usage_territory", "model.apple_store_source.stg_apple_store__usage_territory"], "model.apple_store_source.stg_apple_store__crashes_app_version_tmp": ["model.apple_store_source.stg_apple_store__crashes_app_version", "model.apple_store_source.stg_apple_store__crashes_app_version"], "model.apple_store_source.stg_apple_store__downloads_device_tmp": ["model.apple_store_source.stg_apple_store__downloads_device", "model.apple_store_source.stg_apple_store__downloads_device"], "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp": ["model.apple_store_source.stg_apple_store__crashes_platform_version", "model.apple_store_source.stg_apple_store__crashes_platform_version"], "model.apple_store_source.stg_apple_store__app_store_device_tmp": ["model.apple_store_source.stg_apple_store__app_store_device", "model.apple_store_source.stg_apple_store__app_store_device"], "model.apple_store_source.stg_apple_store__usage_app_version_tmp": ["model.apple_store_source.stg_apple_store__usage_app_version", "model.apple_store_source.stg_apple_store__usage_app_version"], "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp": ["model.apple_store_source.stg_apple_store__app_store_platform_version", "model.apple_store_source.stg_apple_store__app_store_platform_version"], "model.apple_store_source.stg_apple_store__usage_device_tmp": ["model.apple_store_source.stg_apple_store__usage_device", "model.apple_store_source.stg_apple_store__usage_device"], "seed.apple_store_source.apple_store_country_codes": ["model.apple_store.apple_store__territory_report"], "model.apple_store.apple_store__source_type_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092"], "model.apple_store.apple_store__platform_version_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68"], "model.apple_store.apple_store__territory_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6"], "model.apple_store.apple_store__device_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996"], "model.apple_store.apple_store__app_version_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca"], "model.apple_store.apple_store__overview_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968"], "model.apple_store.int_apple_store__app_store_source_type": ["model.apple_store.apple_store__source_type_report"], "model.apple_store.int_apple_store__downloads_source_type": ["model.apple_store.apple_store__source_type_report"], "model.apple_store.int_apple_store__usage_source_type": ["model.apple_store.apple_store__source_type_report"], "model.apple_store.int_apple_store__usage_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__downloads_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__crashes_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__app_store_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__platform_version": ["model.apple_store.apple_store__platform_version_report"], "model.apple_store.int_apple_store__crashes_app_version": ["model.apple_store.apple_store__app_version_report"], "model.apple_store.int_apple_store__crashes_device": ["model.apple_store.apple_store__device_report"], "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6": [], "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca": [], "source.apple_store_source.apple_store.app": [], "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": [], "source.apple_store_source.apple_store.app_store_source_type_device_report": [], "source.apple_store_source.apple_store.app_store_territory_source_type_report": [], "source.apple_store_source.apple_store.crashes_app_version_device_report": [], "source.apple_store_source.apple_store.crashes_platform_version_device_report": [], "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": [], "source.apple_store_source.apple_store.downloads_source_type_device_report": [], "source.apple_store_source.apple_store.downloads_territory_source_type_report": [], "source.apple_store_source.apple_store.sales_account": [], "source.apple_store_source.apple_store.sales_subscription_event_summary": [], "source.apple_store_source.apple_store.sales_subscription_summary": [], "source.apple_store_source.apple_store.usage_app_version_source_type_report": [], "source.apple_store_source.apple_store.usage_platform_version_source_type_report": [], "source.apple_store_source.apple_store.usage_source_type_device_report": [], "source.apple_store_source.apple_store.usage_territory_source_type_report": []}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-05-31T22:13:40.159153Z", "invocation_id": "155a3a3c-5eb4-42e2-a4c8-3b52c18055f6", "env": {}, "project_id": "694016150451044e4ea5e317a0bdf1bd", "user_id": "535a716f-60c0-47b9-9763-5e1b450166b6", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.apple_store_integration_tests.sales_account": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "sales_account"], "unique_id": "seed.apple_store_integration_tests.sales_account", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "sales_account.csv", "original_file_path": "seeds/sales_account.csv", "name": "sales_account", "alias": "sales_account", "checksum": {"name": "sha256", "checksum": "b0beb05040309720fd22ec4cd11c9b4abd9914e48f47b8f6b0cc3e08a57c8a85"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5112221, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_account`"}, "seed.apple_store_integration_tests.sales_subscription_summary": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "sales_subscription_summary"], "unique_id": "seed.apple_store_integration_tests.sales_subscription_summary", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "sales_subscription_summary.csv", "original_file_path": "seeds/sales_subscription_summary.csv", "name": "sales_subscription_summary", "alias": "sales_subscription_summary", "checksum": {"name": "sha256", "checksum": "feb7b6555873c3c5d12637db6a08f11d103bb7c5875ae4ac18dd2a06f02553a1"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.523745, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_subscription_summary`"}, "seed.apple_store_integration_tests.downloads_source_type_device": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "downloads_source_type_device"], "unique_id": "seed.apple_store_integration_tests.downloads_source_type_device", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "downloads_source_type_device.csv", "original_file_path": "seeds/downloads_source_type_device.csv", "name": "downloads_source_type_device", "alias": "downloads_source_type_device", "checksum": {"name": "sha256", "checksum": "a3cda4bfc0ad2bfffd8a7b9f80b1dac0b86e1547ecdc0199ca229890f46a3d37"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.525929, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_source_type_device`"}, "seed.apple_store_integration_tests.crashes_platform_version": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "crashes_platform_version"], "unique_id": "seed.apple_store_integration_tests.crashes_platform_version", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "crashes_platform_version.csv", "original_file_path": "seeds/crashes_platform_version.csv", "name": "crashes_platform_version", "alias": "crashes_platform_version", "checksum": {"name": "sha256", "checksum": "c31e1b3459a5eff06b81f214930f90d70559a65cae557dac7a967cc9dfe274b9"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5278862, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`crashes_platform_version`"}, "seed.apple_store_integration_tests.usage_app_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_app_version_source_type"], "unique_id": "seed.apple_store_integration_tests.usage_app_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_app_version_source_type.csv", "original_file_path": "seeds/usage_app_version_source_type.csv", "name": "usage_app_version_source_type", "alias": "usage_app_version_source_type", "checksum": {"name": "sha256", "checksum": "890b8d476624630b14e7eda1f907df13dc9fa1a80b21326752552021c8ace4e6"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5297558, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_app_version_source_type`"}, "seed.apple_store_integration_tests.sales_subscription_events": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "sales_subscription_events"], "unique_id": "seed.apple_store_integration_tests.sales_subscription_events", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "sales_subscription_events.csv", "original_file_path": "seeds/sales_subscription_events.csv", "name": "sales_subscription_events", "alias": "sales_subscription_events", "checksum": {"name": "sha256", "checksum": "04c613e3c10db418886b7e313db88a9e2a074e2ea106de540fbc59d3a2d381de"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5315478, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`sales_subscription_events`"}, "seed.apple_store_integration_tests.crashes_app_version": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "crashes_app_version"], "unique_id": "seed.apple_store_integration_tests.crashes_app_version", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "crashes_app_version.csv", "original_file_path": "seeds/crashes_app_version.csv", "name": "crashes_app_version", "alias": "crashes_app_version", "checksum": {"name": "sha256", "checksum": "e527991e8d57f4cc314d8fecfd05fa7534a490661962306f001c0b40631bac43"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.533501, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`crashes_app_version`"}, "seed.apple_store_integration_tests.downloads_territory_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "downloads_territory_source_type"], "unique_id": "seed.apple_store_integration_tests.downloads_territory_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "downloads_territory_source_type.csv", "original_file_path": "seeds/downloads_territory_source_type.csv", "name": "downloads_territory_source_type", "alias": "downloads_territory_source_type", "checksum": {"name": "sha256", "checksum": "7a404692d812424fb2dae99130aa4bca94ebd6c6acb8bfaef51698896fbc4de3"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.535244, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_territory_source_type`"}, "seed.apple_store_integration_tests.usage_territory_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_territory_source_type"], "unique_id": "seed.apple_store_integration_tests.usage_territory_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_territory_source_type.csv", "original_file_path": "seeds/usage_territory_source_type.csv", "name": "usage_territory_source_type", "alias": "usage_territory_source_type", "checksum": {"name": "sha256", "checksum": "6da52999e8d07014078385028042c5d7983c5a53e3b03d3c36a215a3a770fb60"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.536999, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_territory_source_type`"}, "seed.apple_store_integration_tests.usage_source_type_device": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_source_type_device"], "unique_id": "seed.apple_store_integration_tests.usage_source_type_device", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_source_type_device.csv", "original_file_path": "seeds/usage_source_type_device.csv", "name": "usage_source_type_device", "alias": "usage_source_type_device", "checksum": {"name": "sha256", "checksum": "92ee795bbf366b5b15a07481f61e5e9857d5e37596985d5e9f693555f23edf79"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.538753, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_source_type_device`"}, "seed.apple_store_integration_tests.app_store_territory_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app_store_territory_source_type"], "unique_id": "seed.apple_store_integration_tests.app_store_territory_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app_store_territory_source_type.csv", "original_file_path": "seeds/app_store_territory_source_type.csv", "name": "app_store_territory_source_type", "alias": "app_store_territory_source_type", "checksum": {"name": "sha256", "checksum": "6278fc0117fee62477e9b87cfb6d6b4806375ed1abce39f699c32079c2bb912d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.540709, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_territory_source_type`"}, "seed.apple_store_integration_tests.app_store_platform_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app_store_platform_version_source_type"], "unique_id": "seed.apple_store_integration_tests.app_store_platform_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app_store_platform_version_source_type.csv", "original_file_path": "seeds/app_store_platform_version_source_type.csv", "name": "app_store_platform_version_source_type", "alias": "app_store_platform_version_source_type", "checksum": {"name": "sha256", "checksum": "91387e5b27f61e4b3d96153027f655b1827a9fa00273395a5d1b3b3ce0696d82"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.542467, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_platform_version_source_type`"}, "seed.apple_store_integration_tests.usage_platform_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "usage_platform_version_source_type"], "unique_id": "seed.apple_store_integration_tests.usage_platform_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "usage_platform_version_source_type.csv", "original_file_path": "seeds/usage_platform_version_source_type.csv", "name": "usage_platform_version_source_type", "alias": "usage_platform_version_source_type", "checksum": {"name": "sha256", "checksum": "075debe615e09ad5eb25f920aca3c9e4a5a24d9787ad444dde0adac6a0c1eab4"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5442162, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`usage_platform_version_source_type`"}, "seed.apple_store_integration_tests.downloads_platform_version_source_type": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "downloads_platform_version_source_type"], "unique_id": "seed.apple_store_integration_tests.downloads_platform_version_source_type", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "downloads_platform_version_source_type.csv", "original_file_path": "seeds/downloads_platform_version_source_type.csv", "name": "downloads_platform_version_source_type", "alias": "downloads_platform_version_source_type", "checksum": {"name": "sha256", "checksum": "134152125ea3264f55419ce6985f5ca1c42c1aefe2c2d33cc6e9e1436a1bdf09"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5459871, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`downloads_platform_version_source_type`"}, "seed.apple_store_integration_tests.app": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app"], "unique_id": "seed.apple_store_integration_tests.app", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app.csv", "original_file_path": "seeds/app.csv", "name": "app", "alias": "app", "checksum": {"name": "sha256", "checksum": "7c127fe1a3eef27fc38a41632059ef1ca791b3d48469a25531c7f094586681c5"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.547775, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app`"}, "seed.apple_store_integration_tests.app_store_source_type_device": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests", "fqn": ["apple_store_integration_tests", "app_store_source_type_device"], "unique_id": "seed.apple_store_integration_tests.app_store_source_type_device", "package_name": "apple_store_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests", "path": "app_store_source_type_device.csv", "original_file_path": "seeds/app_store_source_type_device.csv", "name": "app_store_source_type_device", "alias": "app_store_source_type_device", "checksum": {"name": "sha256", "checksum": "8b3ebc33706e64f998b00068ca21f0312cb19b0fb09ee88baa164b747853daf7"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp", "date": "timestamp"}}, "created_at": 1654035146.5497, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests`.`app_store_source_type_device`"}, "model.apple_store_source.stg_apple_store__crashes_app_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__crashes_app_version_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__crashes_app_version_tmp')),\n staging_columns=get_crashes_app_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n app_version,\n crashes\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_crashes_app_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version_tmp", "model.apple_store_source.stg_apple_store__crashes_app_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__crashes_app_version"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__crashes_app_version.sql", "original_file_path": "models/stg_apple_store__crashes_app_version.sql", "name": "stg_apple_store__crashes_app_version", "alias": "stg_apple_store__crashes_app_version", "checksum": {"name": "sha256", "checksum": "4152d297444a3386891570f3819ca7f70f1f2e7b85590459f365d6cd667502f7"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version_tmp"], ["stg_apple_store__crashes_app_version_tmp"]], "sources": [], "description": "Daily crashes by app version and device.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__crashes_app_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.160629, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n string\n) as \n \n app_version\n \n , \n cast(null as \n int64\n) as \n \n crashes\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n app_version,\n crashes\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`"}, "model.apple_store_source.stg_apple_store__sales_account": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__sales_account_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__sales_account_tmp')),\n staging_columns=get_sales_account_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as account_id,\n name as account_name\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_sales_account_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__sales_account_tmp", "model.apple_store_source.stg_apple_store__sales_account_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__sales_account"], "unique_id": "model.apple_store_source.stg_apple_store__sales_account", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__sales_account.sql", "original_file_path": "models/stg_apple_store__sales_account.sql", "name": "stg_apple_store__sales_account", "alias": "stg_apple_store__sales_account", "checksum": {"name": "sha256", "checksum": "c2472debd8bec0026814b51414c028a2227731d8d9bd88a6dd011d9512196dfe"}, "tags": [], "refs": [["stg_apple_store__sales_account_tmp"], ["stg_apple_store__sales_account_tmp"]], "sources": [], "description": "Table containing sales account data.", "columns": {"account_id": {"name": "account_id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Sales Account Name associated with the Sales Account ID, app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__sales_account.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.17065, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n id\n \n , \n cast(null as \n string\n) as \n \n name\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as account_id,\n name as account_name\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`"}, "model.apple_store_source.stg_apple_store__usage_app_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_app_version_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__usage_app_version_tmp')),\n staging_columns=get_usage_app_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n app_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_app_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_app_version_tmp", "model.apple_store_source.stg_apple_store__usage_app_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_app_version"], "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_app_version.sql", "original_file_path": "models/stg_apple_store__usage_app_version.sql", "name": "stg_apple_store__usage_app_version", "alias": "stg_apple_store__usage_app_version", "checksum": {"name": "sha256", "checksum": "ef1fedbff64606fd3d92c6673db2a89c612a781305e3ef10bbf2e58cfc8b2962"}, "tags": [], "refs": [["stg_apple_store__usage_app_version_tmp"], ["stg_apple_store__usage_app_version_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by app version and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_app_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.179807, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n string\n) as \n \n app_version\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n app_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version`"}, "model.apple_store_source.stg_apple_store__app_store_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_store_platform_version_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__app_store_platform_version_tmp')),\n staging_columns=get_app_store_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_store_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_platform_version_tmp", "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app_store_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app_store_platform_version.sql", "original_file_path": "models/stg_apple_store__app_store_platform_version.sql", "name": "stg_apple_store__app_store_platform_version", "alias": "stg_apple_store__app_store_platform_version", "checksum": {"name": "sha256", "checksum": "3d2e066952112faf88e6d70817cf95e41ad8147948c42ff6e516ef909240ec58"}, "tags": [], "refs": [["stg_apple_store__app_store_platform_version_tmp"], ["stg_apple_store__app_store_platform_version_tmp"]], "sources": [], "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by platform version and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app_store_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.156043, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n impressions\n \n , \n cast(null as \n int64\n) as \n \n impressions_unique_device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n page_views\n \n , \n cast(null as \n int64\n) as \n \n page_views_unique_device\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version`"}, "model.apple_store_source.stg_apple_store__app_store_territory": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_store_territory_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__app_store_territory_tmp')),\n staging_columns=get_app_store_territory_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_store_territory_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_territory_tmp", "model.apple_store_source.stg_apple_store__app_store_territory_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app_store_territory"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app_store_territory.sql", "original_file_path": "models/stg_apple_store__app_store_territory.sql", "name": "stg_apple_store__app_store_territory", "alias": "stg_apple_store__app_store_territory", "checksum": {"name": "sha256", "checksum": "77121ff9044c336bd288784cd337a7d27c66b80ddd4e2c3649ceb45d298c7716"}, "tags": [], "refs": [["stg_apple_store__app_store_territory_tmp"], ["stg_apple_store__app_store_territory_tmp"]], "sources": [], "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by territory and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app_store_territory.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.1586401, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n impressions\n \n , \n cast(null as \n int64\n) as \n \n impressions_unique_device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n page_views\n \n , \n cast(null as \n int64\n) as \n \n page_views_unique_device\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n string\n) as \n \n territory\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory`"}, "model.apple_store_source.stg_apple_store__app_store_device": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_store_device_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__app_store_device_tmp')),\n staging_columns=get_app_store_device_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_store_device_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device_tmp", "model.apple_store_source.stg_apple_store__app_store_device_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app_store_device"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app_store_device.sql", "original_file_path": "models/stg_apple_store__app_store_device.sql", "name": "stg_apple_store__app_store_device", "alias": "stg_apple_store__app_store_device", "checksum": {"name": "sha256", "checksum": "87bde60bb2359cbb0987d42229cdc05c4f062812c725e66eac792301e75947b4"}, "tags": [], "refs": [["stg_apple_store__app_store_device_tmp"], ["stg_apple_store__app_store_device_tmp"]], "sources": [], "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by device and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app_store_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.153327, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n impressions\n \n , \n cast(null as \n int64\n) as \n \n impressions_unique_device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n page_views\n \n , \n cast(null as \n int64\n) as \n \n page_views_unique_device\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n impressions,\n impressions_unique_device,\n page_views,\n page_views_unique_device\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`"}, "model.apple_store_source.stg_apple_store__usage_device": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_device_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__usage_device_tmp')),\n staging_columns=get_usage_device_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_device_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device_tmp", "model.apple_store_source.stg_apple_store__usage_device_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_device"], "unique_id": "model.apple_store_source.stg_apple_store__usage_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_device.sql", "original_file_path": "models/stg_apple_store__usage_device.sql", "name": "stg_apple_store__usage_device", "alias": "stg_apple_store__usage_device", "checksum": {"name": "sha256", "checksum": "5cf7e0de6c587773594c3aaafc8f937a779755c17ba8449771ce3566ed8d050f"}, "tags": [], "refs": [["stg_apple_store__usage_device_tmp"], ["stg_apple_store__usage_device_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by device and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.182793, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`"}, "model.apple_store_source.stg_apple_store__downloads_device": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__downloads_device_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__downloads_device_tmp')),\n staging_columns=get_downloads_device_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_downloads_device_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device_tmp", "model.apple_store_source.stg_apple_store__downloads_device_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__downloads_device"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__downloads_device.sql", "original_file_path": "models/stg_apple_store__downloads_device.sql", "name": "stg_apple_store__downloads_device", "alias": "stg_apple_store__downloads_device", "checksum": {"name": "sha256", "checksum": "490e6f476c808d903aec7484de92a2e7ee7fb13dd42c2296a39b1de35f9ff647"}, "tags": [], "refs": [["stg_apple_store__downloads_device_tmp"], ["stg_apple_store__downloads_device_tmp"]], "sources": [], "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by device and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__downloads_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.164771, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n first_time_downloads\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n redownloads\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n int64\n) as \n \n total_downloads\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n device,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`"}, "model.apple_store_source.stg_apple_store__sales_subscription_events": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_apple_store__sales_subscription_events_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__sales_subscription_events_tmp')),\n staging_columns=get_sales_subscription_events_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n event_date as date_day, \n account_number as account_id,\n app_name,\n subscription_name,\n event,\n country,\n case\n when replace(state, ' ', '') = '' then cast(null as {{ dbt_utils.type_string() }}) else state\n end as state,\n case \n when lower(device) like 'ipod%' then 'iPod' else device\n end as device,\n sum(quantity) as quantity\n from fields\n {{ dbt_utils.group_by(8) }}\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_sales_subscription_events_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__sales_subscription_events_tmp", "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__sales_subscription_events"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_events", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__sales_subscription_events.sql", "original_file_path": "models/stg_apple_store__sales_subscription_events.sql", "name": "stg_apple_store__sales_subscription_events", "alias": "stg_apple_store__sales_subscription_events", "checksum": {"name": "sha256", "checksum": "053b75672e3e767cdaa713a44ea74f88b8802ad2d545eadec020fc121ee58863"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_events_tmp"], ["stg_apple_store__sales_subscription_events_tmp"]], "sources": [], "description": "Daily subscription event report by account ID, app name, subscription name, event, country, state and device; this model is aggregated by date, app_name, account_id, country, state and subscription_name for easier transformations in the modeling package.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "event": {"name": "event", "description": "The subscription event associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of occurrences of a given subscription event.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__sales_subscription_events.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source", "enabled": true}, "created_at": 1654035147.17363, "compiled_sql": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n string\n) as \n \n _filename\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n _index\n \n , \n cast(null as \n int64\n) as \n \n account_number\n \n , \n cast(null as \n int64\n) as \n \n app_apple_id\n \n , \n cast(null as \n string\n) as \n \n app_name\n \n , \n cast(null as \n string\n) as \n \n cancellation_reason\n \n , \n cast(null as \n int64\n) as \n \n consecutive_paid_periods\n \n , \n cast(null as \n string\n) as \n \n country\n \n , \n cast(null as \n string\n) as \n \n days_before_canceling\n \n , \n cast(null as \n string\n) as \n \n days_canceled\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n string\n) as \n \n event\n \n , \n cast(null as \n string\n) as \n \n event_date\n \n , \n cast(null as \n string\n) as \n \n marketing_opt_in_duration\n \n , \n cast(null as \n string\n) as \n \n original_start_date\n \n , \n cast(null as \n string\n) as \n \n previous_subscription_apple_id\n \n , \n cast(null as \n string\n) as \n \n previous_subscription_name\n \n , \n cast(null as \n string\n) as \n \n proceeds_reason\n \n , \n cast(null as \n string\n) as \n \n promotional_offer_id\n \n , \n cast(null as \n string\n) as \n \n promotional_offer_name\n \n , \n cast(null as \n int64\n) as \n \n quantity\n \n , \n cast(null as \n string\n) as \n \n standard_subscription_duration\n \n , \n cast(null as \n string\n) as \n \n state\n \n , \n cast(null as \n int64\n) as \n \n subscription_apple_id\n \n , \n cast(null as \n int64\n) as \n \n subscription_group_id\n \n , \n cast(null as \n string\n) as \n \n subscription_name\n \n , \n cast(null as \n string\n) as \n \n subscription_offer_duration\n \n , \n cast(null as \n string\n) as \n \n subscription_offer_type\n \n , \n cast(null as \n int64\n) as \n \n vendor_number\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n event_date as date_day, \n account_number as account_id,\n app_name,\n subscription_name,\n event,\n country,\n case\n when replace(state, ' ', '') = '' then cast(null as \n string\n) else state\n end as state,\n case \n when lower(device) like 'ipod%' then 'iPod' else device\n end as device,\n sum(quantity) as quantity\n from fields\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`"}, "model.apple_store_source.stg_apple_store__usage_territory": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_territory_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__usage_territory_tmp')),\n staging_columns=get_usage_territory_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_territory_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_territory_tmp", "model.apple_store_source.stg_apple_store__usage_territory_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_territory"], "unique_id": "model.apple_store_source.stg_apple_store__usage_territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_territory.sql", "original_file_path": "models/stg_apple_store__usage_territory.sql", "name": "stg_apple_store__usage_territory", "alias": "stg_apple_store__usage_territory", "checksum": {"name": "sha256", "checksum": "45b9dc4ad2ecdcd950433d16f9c3d1721ea9db07d3db75f3a33d6f1cded7ae6c"}, "tags": [], "refs": [["stg_apple_store__usage_territory_tmp"], ["stg_apple_store__usage_territory_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by territory and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_territory.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.188643, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n string\n) as \n \n territory\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory`"}, "model.apple_store_source.stg_apple_store__sales_subscription_summary": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_apple_store__sales_subscription_summary_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__sales_subscription_summary_tmp')),\n staging_columns=get_sales_subscription_summary_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n {{ get_date_from_string( dbt_utils.split_part(string_text='_filename', delimiter_text=\"'_'\", part_number=3) ) }} as date_day, \n app_name,\n account_number as account_id,\n country,\n case\n when replace(state, ' ', '') = '' then cast(null as {{ dbt_utils.type_string() }}) else state\n end as state,\n subscription_name,\n case \n when lower(device) like 'ipod%' then 'iPod' else device\n end as device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from fields\n {{ dbt_utils.group_by(7) }}\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_sales_subscription_summary_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.split_part", "macro.apple_store_source.get_date_from_string", "macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp", "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__sales_subscription_summary"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_summary", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__sales_subscription_summary.sql", "original_file_path": "models/stg_apple_store__sales_subscription_summary.sql", "name": "stg_apple_store__sales_subscription_summary", "alias": "stg_apple_store__sales_subscription_summary", "checksum": {"name": "sha256", "checksum": "55863bd8409488af65d2a64576aaf493d943da522e03b41d97abfaa14b4e8883"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_summary_tmp"], ["stg_apple_store__sales_subscription_summary_tmp"]], "sources": [], "description": "Daily subscription summary report by account ID, app name, country, state and subscription name; this model is aggregated by date, app_name, account_id, country, state and subscription_name for easier transformations in the modeling package.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_free_trial_introductory_offer_subscriptions": {"name": "active_free_trial_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently in a free trial.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_pay_as_you_go_introductory_offer_subscriptions": {"name": "active_pay_as_you_go_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently with a pay as you go introductory price.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_pay_up_front_introductory_offer_subscriptions": {"name": "active_pay_up_front_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently with a pay up front introductory price.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_standard_price_subscriptions": {"name": "active_standard_price_subscriptions", "description": "Total number of auto-renewable standard paid subscriptions currently active, excluding free trials, \nsubscription offers, introductory offers, and marketing opt-ins. Subscriptions are active during the period for which the customer has paid without cancellation.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__sales_subscription_summary.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source", "enabled": true}, "created_at": 1654035147.176933, "compiled_sql": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n string\n) as \n \n _filename\n \n , \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n _index\n \n , \n cast(null as \n int64\n) as \n \n account_number\n \n , \n cast(null as \n int64\n) as \n \n active_free_trial_introductory_offer_subscriptions\n \n , \n cast(null as \n int64\n) as \n \n active_pay_as_you_go_introductory_offer_subscriptions\n \n , \n cast(null as \n int64\n) as \n \n active_pay_up_front_introductory_offer_subscriptions\n \n , \n cast(null as \n int64\n) as \n \n active_standard_price_subscriptions\n \n , \n cast(null as \n int64\n) as \n \n app_apple_id\n \n , \n cast(null as \n string\n) as \n \n app_name\n \n , \n cast(null as \n int64\n) as \n \n billing_retry\n \n , \n cast(null as \n string\n) as \n \n country\n \n , \n cast(null as \n string\n) as \n \n customer_currency\n \n , \n cast(null as \n float64\n) as \n \n customer_price\n \n , \n cast(null as \n float64\n) as \n \n developer_proceeds\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as \n int64\n) as \n \n free_trial_promotional_offer_subscriptions\n \n , \n cast(null as \n int64\n) as \n \n grace_period\n \n , \n cast(null as \n int64\n) as \n \n marketing_opt_ins\n \n , \n cast(null as \n int64\n) as \n \n pay_as_you_go_promotional_offer_subscriptions\n \n , \n cast(null as \n int64\n) as \n \n pay_up_front_promotional_offer_subscriptions\n \n , \n cast(null as \n string\n) as \n \n proceeds_currency\n \n , \n cast(null as \n string\n) as \n \n proceeds_reason\n \n , \n cast(null as \n string\n) as \n \n promotional_offer_id\n \n , \n cast(null as \n string\n) as \n \n promotional_offer_name\n \n , \n cast(null as \n string\n) as \n \n standard_subscription_duration\n \n , \n cast(null as \n string\n) as \n \n state\n \n , \n cast(null as \n int64\n) as \n \n subscription_apple_id\n \n , \n cast(null as \n int64\n) as \n \n subscription_group_id\n \n , \n cast(null as \n string\n) as \n \n subscription_name\n \n , \n cast(null as \n int64\n) as \n \n vendor_number\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n \n\n parse_date(\n '%Y%m%d',\n \n\n \n split(\n _filename,\n '_'\n )[safe_offset(2)]\n \n\n\n )\n\n as date_day, \n app_name,\n account_number as account_id,\n country,\n case\n when replace(state, ' ', '') = '' then cast(null as \n string\n) else state\n end as state,\n subscription_name,\n case \n when lower(device) like 'ipod%' then 'iPod' else device\n end as device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from fields\n group by 1,2,3,4,5,6,7\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`"}, "model.apple_store_source.stg_apple_store__crashes_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__crashes_platform_version_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__crashes_platform_version_tmp')),\n staging_columns=get_crashes_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n platform_version,\n crashes\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_crashes_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_platform_version_tmp", "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__crashes_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__crashes_platform_version.sql", "original_file_path": "models/stg_apple_store__crashes_platform_version.sql", "name": "stg_apple_store__crashes_platform_version", "alias": "stg_apple_store__crashes_platform_version", "checksum": {"name": "sha256", "checksum": "5c1bb98bd43249cfcefafb2dcd1aabe4b5ebdf24eb82d7067e9a0f26a671bc61"}, "tags": [], "refs": [["stg_apple_store__crashes_platform_version_tmp"], ["stg_apple_store__crashes_platform_version_tmp"]], "sources": [], "description": "Daily crashes by platform version and device.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__crashes_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.162426, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n int64\n) as \n \n crashes\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n string\n) as \n \n device\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n device,\n platform_version,\n crashes\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`"}, "model.apple_store_source.stg_apple_store__app": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__app_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__app_tmp')),\n staging_columns=get_app_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n id as app_id,\n name as app_name,\n is_enabled\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_app_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__app_tmp", "model.apple_store_source.stg_apple_store__app_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__app"], "unique_id": "model.apple_store_source.stg_apple_store__app", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__app.sql", "original_file_path": "models/stg_apple_store__app.sql", "name": "stg_apple_store__app", "alias": "stg_apple_store__app", "checksum": {"name": "sha256", "checksum": "78c6ba718bc3d1d91eddbd2dad1df5727f976b9378038943fa3aa057e9e72d6e"}, "tags": [], "refs": [["stg_apple_store__app_tmp"], ["stg_apple_store__app_tmp"]], "sources": [], "description": "Table containing data about your application(s)", "columns": {"app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicator for whether application is enabled or not.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__app.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.1507142, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_opt_in_rate\n \n , \n cast(null as \n string\n) as \n \n asset_token\n \n , \n cast(null as \n string\n) as \n \n icon_url\n \n , \n cast(null as \n int64\n) as \n \n id\n \n , \n cast(null as boolean) as \n \n ios\n \n , \n cast(null as boolean) as \n \n is_bundle\n \n , \n cast(null as boolean) as \n \n is_enabled\n \n , \n cast(null as \n string\n) as \n \n name\n \n , \n cast(null as \n string\n) as \n \n pre_order_info\n \n , \n cast(null as boolean) as \n \n tvos\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n id as app_id,\n name as app_name,\n is_enabled\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`"}, "model.apple_store_source.stg_apple_store__downloads_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__downloads_platform_version_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__downloads_platform_version_tmp')),\n staging_columns=get_downloads_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_downloads_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_platform_version_tmp", "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__downloads_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__downloads_platform_version.sql", "original_file_path": "models/stg_apple_store__downloads_platform_version.sql", "name": "stg_apple_store__downloads_platform_version", "alias": "stg_apple_store__downloads_platform_version", "checksum": {"name": "sha256", "checksum": "d5044940cb08750821933c49f47e547a675fbe58780ec5d4577e998ba5e82ccf"}, "tags": [], "refs": [["stg_apple_store__downloads_platform_version_tmp"], ["stg_apple_store__downloads_platform_version_tmp"]], "sources": [], "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__downloads_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.167207, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n first_time_downloads\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n , \n cast(null as \n int64\n) as \n \n redownloads\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n int64\n) as \n \n total_downloads\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version`"}, "model.apple_store_source.stg_apple_store__usage_platform_version": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__usage_platform_version_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__usage_platform_version_tmp')),\n staging_columns=get_usage_platform_version_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_usage_platform_version_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__usage_platform_version_tmp", "model.apple_store_source.stg_apple_store__usage_platform_version_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__usage_platform_version"], "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__usage_platform_version.sql", "original_file_path": "models/stg_apple_store__usage_platform_version.sql", "name": "stg_apple_store__usage_platform_version", "alias": "stg_apple_store__usage_platform_version", "checksum": {"name": "sha256", "checksum": "86f0c67b92f3c7551fae2df2b8b1d22357c849e63eee97bdf87b0a230f0e3fd0"}, "tags": [], "refs": [["stg_apple_store__usage_platform_version_tmp"], ["stg_apple_store__usage_platform_version_tmp"]], "sources": [], "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by platform version and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__usage_platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.185774, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n active_devices\n \n , \n cast(null as \n int64\n) as \n \n active_devices_last_30_days\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n deletions\n \n , \n cast(null as \n int64\n) as \n \n installations\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n string\n) as \n \n platform_version\n \n , \n cast(null as \n int64\n) as \n \n sessions\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n platform_version,\n active_devices,\n active_devices_last_30_days,\n deletions,\n installations,\n sessions\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version`"}, "model.apple_store_source.stg_apple_store__downloads_territory": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_apple_store__downloads_territory_tmp') }}\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_apple_store__downloads_territory_tmp')),\n staging_columns=get_downloads_territory_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.apple_store_source.get_downloads_territory_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_territory_tmp", "model.apple_store_source.stg_apple_store__downloads_territory_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "stg_apple_store__downloads_territory"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "stg_apple_store__downloads_territory.sql", "original_file_path": "models/stg_apple_store__downloads_territory.sql", "name": "stg_apple_store__downloads_territory", "alias": "stg_apple_store__downloads_territory", "checksum": {"name": "sha256", "checksum": "888f8b491dbfa4b6c8a941af2c8931eb909e0bd8e391b316fcf76d5d1be89d82"}, "tags": [], "refs": [["stg_apple_store__downloads_territory_tmp"], ["stg_apple_store__downloads_territory_tmp"]], "sources": [], "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by territory and source type.", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store__downloads_territory.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store_source"}, "created_at": 1654035147.169549, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory_tmp`\n),\n\nfields as (\n\n select\n \n cast(null as \n timestamp\n) as \n \n _fivetran_synced\n \n , \n cast(null as \n int64\n) as \n \n app_id\n \n , \n cast(null as \n timestamp\n) as \n \n date\n \n , \n cast(null as \n int64\n) as \n \n first_time_downloads\n \n , \n cast(null as boolean) as \n \n meets_threshold\n \n , \n cast(null as \n int64\n) as \n \n redownloads\n \n , \n cast(null as \n string\n) as \n \n source_type\n \n , \n cast(null as \n string\n) as \n \n territory\n \n , \n cast(null as \n int64\n) as \n \n total_downloads\n \n \n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(date as date) as date_day,\n app_id,\n source_type,\n territory,\n first_time_downloads,\n redownloads,\n total_downloads\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory`"}, "model.apple_store_source.stg_apple_store__app_tmp": {"raw_sql": "select * \nfrom {{ var('app') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.app"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_tmp.sql", "name": "stg_apple_store__app_tmp", "alias": "stg_apple_store__app_tmp", "checksum": {"name": "sha256", "checksum": "05c08f2d398ec0de4d08b6674e60d9dbc07e9417001b3d244b9f6e4802708604"}, "tags": [], "refs": [], "sources": [["apple_store", "app"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.801963, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`app`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_tmp`"}, "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nselect * \nfrom {{ var('sales_subscription_events') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.sales_subscription_event_summary"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__sales_subscription_events_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__sales_subscription_events_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__sales_subscription_events_tmp.sql", "name": "stg_apple_store__sales_subscription_events_tmp", "alias": "stg_apple_store__sales_subscription_events_tmp", "checksum": {"name": "sha256", "checksum": "c198d698a4cda29cbc43a676b98a48d777285dbfeaba4f3dbee27cf9a00bf0e8"}, "tags": [], "refs": [], "sources": [["apple_store", "sales_subscription_event_summary"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__sales_subscription_events_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source", "enabled": true}, "created_at": 1654035146.8065789, "compiled_sql": "\n\nselect * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`sales_subscription_events`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events_tmp`"}, "model.apple_store_source.stg_apple_store__usage_platform_version_tmp": {"raw_sql": "select * \nfrom {{ var('usage_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.usage_platform_version_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_platform_version_tmp.sql", "name": "stg_apple_store__usage_platform_version_tmp", "alias": "stg_apple_store__usage_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "9353f036378b6052549c6a52900553e5e7bd63e7f2c67d7a5a00e0e732a94de6"}, "tags": [], "refs": [], "sources": [["apple_store", "usage_platform_version_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.811862, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`usage_platform_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__app_store_territory_tmp": {"raw_sql": "select * \nfrom {{ var('app_store_territory') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.app_store_territory_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_store_territory_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_store_territory_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_store_territory_tmp.sql", "name": "stg_apple_store__app_store_territory_tmp", "alias": "stg_apple_store__app_store_territory_tmp", "checksum": {"name": "sha256", "checksum": "3de8f28ef037127375eefaa431b4c45ee86e0c628f27294c9e741e6f35bb2d42"}, "tags": [], "refs": [], "sources": [["apple_store", "app_store_territory_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_store_territory_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.815994, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`app_store_territory_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory_tmp`"}, "model.apple_store_source.stg_apple_store__downloads_territory_tmp": {"raw_sql": "select * \nfrom {{ var('downloads_territory') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.downloads_territory_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__downloads_territory_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__downloads_territory_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__downloads_territory_tmp.sql", "name": "stg_apple_store__downloads_territory_tmp", "alias": "stg_apple_store__downloads_territory_tmp", "checksum": {"name": "sha256", "checksum": "accecece471d7a5184b6557ebe3078e8caeaef1f41fcb660e152d329694bce33"}, "tags": [], "refs": [], "sources": [["apple_store", "downloads_territory_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__downloads_territory_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.820053, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`downloads_territory_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory_tmp`"}, "model.apple_store_source.stg_apple_store__sales_account_tmp": {"raw_sql": "select * \nfrom {{ var('sales_account') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.sales_account"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__sales_account_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__sales_account_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__sales_account_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__sales_account_tmp.sql", "name": "stg_apple_store__sales_account_tmp", "alias": "stg_apple_store__sales_account_tmp", "checksum": {"name": "sha256", "checksum": "2e862c9f0a5994077723782df284e8ce673ef3fc2e6f64e989d3735535d01461"}, "tags": [], "refs": [], "sources": [["apple_store", "sales_account"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__sales_account_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.824105, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`sales_account`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account_tmp`"}, "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp": {"raw_sql": "select * \nfrom {{ var('downloads_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.downloads_platform_version_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__downloads_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__downloads_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__downloads_platform_version_tmp.sql", "name": "stg_apple_store__downloads_platform_version_tmp", "alias": "stg_apple_store__downloads_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "3ef87da45d2fa5dcb6cbdc92844f546501c758af2d4152f1a297b0100b06b6af"}, "tags": [], "refs": [], "sources": [["apple_store", "downloads_platform_version_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__downloads_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.828264, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`downloads_platform_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__usage_territory_tmp": {"raw_sql": "select * \nfrom {{ var('usage_territory') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.usage_territory_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_territory_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_territory_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_territory_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_territory_tmp.sql", "name": "stg_apple_store__usage_territory_tmp", "alias": "stg_apple_store__usage_territory_tmp", "checksum": {"name": "sha256", "checksum": "2ed9a009393e5aacd4439e0006878d4f589368a0458d3708b57562c63a4fab68"}, "tags": [], "refs": [], "sources": [["apple_store", "usage_territory_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_territory_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.8323998, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`usage_territory_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory_tmp`"}, "model.apple_store_source.stg_apple_store__crashes_app_version_tmp": {"raw_sql": "select * \nfrom {{ var('crashes_app_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.crashes_app_version_device_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__crashes_app_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__crashes_app_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__crashes_app_version_tmp.sql", "name": "stg_apple_store__crashes_app_version_tmp", "alias": "stg_apple_store__crashes_app_version_tmp", "checksum": {"name": "sha256", "checksum": "db70a706c15e019a44cee0eace8aa3d731e00fda0fb9dfa49f8f0de2ebcd6bc5"}, "tags": [], "refs": [], "sources": [["apple_store", "crashes_app_version_device_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__crashes_app_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.837204, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`crashes_app_version`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version_tmp`"}, "model.apple_store_source.stg_apple_store__downloads_device_tmp": {"raw_sql": "select * \nfrom {{ var('downloads_device') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.downloads_source_type_device_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__downloads_device_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__downloads_device_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__downloads_device_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__downloads_device_tmp.sql", "name": "stg_apple_store__downloads_device_tmp", "alias": "stg_apple_store__downloads_device_tmp", "checksum": {"name": "sha256", "checksum": "67ebfff65f721b8e4093dbf6cf4ffd513cd41ad64414fef98db427e537a4cd71"}, "tags": [], "refs": [], "sources": [["apple_store", "downloads_source_type_device_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__downloads_device_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.841246, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`downloads_source_type_device`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device_tmp`"}, "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nselect * \nfrom {{ var('sales_subscription_summary') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.sales_subscription_summary"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__sales_subscription_summary_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__sales_subscription_summary_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__sales_subscription_summary_tmp.sql", "name": "stg_apple_store__sales_subscription_summary_tmp", "alias": "stg_apple_store__sales_subscription_summary_tmp", "checksum": {"name": "sha256", "checksum": "558537527d97c96698694f17783604f9851eba77f76d8a293a888b1fe6c60ddc"}, "tags": [], "refs": [], "sources": [["apple_store", "sales_subscription_summary"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__sales_subscription_summary_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source", "enabled": true}, "created_at": 1654035146.845382, "compiled_sql": "\n\nselect * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`sales_subscription_summary`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary_tmp`"}, "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp": {"raw_sql": "select * \nfrom {{ var('crashes_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.crashes_platform_version_device_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__crashes_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__crashes_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__crashes_platform_version_tmp.sql", "name": "stg_apple_store__crashes_platform_version_tmp", "alias": "stg_apple_store__crashes_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "98a2b59c2613eef977b5cb4382bb3ac04c40653c73bc0115c2047ac9cf57d5fb"}, "tags": [], "refs": [], "sources": [["apple_store", "crashes_platform_version_device_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__crashes_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.84991, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`crashes_platform_version`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__app_store_device_tmp": {"raw_sql": "select * \nfrom {{ var('app_store_device') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.app_store_source_type_device_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_store_device_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_device_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_store_device_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_store_device_tmp.sql", "name": "stg_apple_store__app_store_device_tmp", "alias": "stg_apple_store__app_store_device_tmp", "checksum": {"name": "sha256", "checksum": "048d14659bc5d7e7be5f6d7920eed4f891f16e592cc7cd549e99b73e3d6f439f"}, "tags": [], "refs": [], "sources": [["apple_store", "app_store_source_type_device_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_store_device_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.853947, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`app_store_source_type_device`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device_tmp`"}, "model.apple_store_source.stg_apple_store__usage_app_version_tmp": {"raw_sql": "select * \nfrom {{ var('usage_app_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.usage_app_version_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_app_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_app_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_app_version_tmp.sql", "name": "stg_apple_store__usage_app_version_tmp", "alias": "stg_apple_store__usage_app_version_tmp", "checksum": {"name": "sha256", "checksum": "6bdad5685deec3eaca2f84b5065082683f342f8d4347445a5cca0c45bbe44848"}, "tags": [], "refs": [], "sources": [["apple_store", "usage_app_version_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_app_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.858303, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`usage_app_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version_tmp`"}, "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp": {"raw_sql": "select * \nfrom {{ var('app_store_platform_version') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.app_store_platform_version_source_type_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__app_store_platform_version_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__app_store_platform_version_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__app_store_platform_version_tmp.sql", "name": "stg_apple_store__app_store_platform_version_tmp", "alias": "stg_apple_store__app_store_platform_version_tmp", "checksum": {"name": "sha256", "checksum": "7ebbbcd843a7587ec0f6a0f60aeb90af9e8db01b312870ac2ed8706fb1050b82"}, "tags": [], "refs": [], "sources": [["apple_store", "app_store_platform_version_source_type_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__app_store_platform_version_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.863175, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`app_store_platform_version_source_type`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version_tmp`"}, "model.apple_store_source.stg_apple_store__usage_device_tmp": {"raw_sql": "select * \nfrom {{ var('usage_device') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.apple_store_source.apple_store.usage_source_type_device_report"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "tmp", "stg_apple_store__usage_device_tmp"], "unique_id": "model.apple_store_source.stg_apple_store__usage_device_tmp", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "tmp/stg_apple_store__usage_device_tmp.sql", "original_file_path": "models/tmp/stg_apple_store__usage_device_tmp.sql", "name": "stg_apple_store__usage_device_tmp", "alias": "stg_apple_store__usage_device_tmp", "checksum": {"name": "sha256", "checksum": "e2025c3c6f7d123e7dff87572d350d6702c4f7d6a219d8d49fbdc3b5d0f80e31"}, "tags": [], "refs": [], "sources": [["apple_store", "usage_source_type_device_report"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/tmp/stg_apple_store__usage_device_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "apple_store_source"}, "created_at": 1654035146.86721, "compiled_sql": "select * \nfrom `dbt-package-testing`.`apple_store_integration_tests`.`usage_source_type_device`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device_tmp`"}, "seed.apple_store_source.apple_store_country_codes": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "apple_store_source", "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store_source", "fqn": ["apple_store_source", "apple_store_country_codes"], "unique_id": "seed.apple_store_source.apple_store_country_codes", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "apple_store_country_codes.csv", "original_file_path": "seeds/apple_store_country_codes.csv", "name": "apple_store_country_codes", "alias": "apple_store_country_codes", "checksum": {"name": "sha256", "checksum": "8060985550563a0c6038205790d5c1bdba362d13e0cfed88fb781419e38be20c"}, "tags": [], "refs": [], "sources": [], "description": "ISO-3166 country mapping table", "columns": {"country_name": {"name": "country_name", "description": "The ISO-3166 English country name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alternative_country_name": {"name": "alternative_country_name", "description": "Due to differences in the official ISO country names and Apple's naming convention, we've added an alternative territory name that will allow us to join reports and infer ISO fields.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code_numeric": {"name": "country_code_numeric", "description": "The 3 digit ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code_alpha_2": {"name": "country_code_alpha_2", "description": "The 2 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_code_alpha3": {"name": "country_code_alpha3", "description": "The 3 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region": {"name": "region", "description": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region_code": {"name": "region_code", "description": "The UN Statistics region numerical code assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region": {"name": "sub_region", "description": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region_code": {"name": "sub_region_code", "description": "The UN Statistics sub-region numerical code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store_source://models/stg_apple_store.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "apple_store_source"}, "created_at": 1654035147.2734761, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`apple_store_country_codes`"}, "model.apple_store.apple_store__source_type_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_source_type as (\n\n select *\n from {{ ref('int_apple_store__app_store_source_type') }}\n),\n\ndownloads_source_type as (\n\n select *\n from {{ ref('int_apple_store__downloads_source_type') }}\n),\n\nusage_source_type as (\n\n select *\n from {{ ref('int_apple_store__usage_source_type') }}\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type\n from app_store_source_type\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n coalesce(app_store_source_type.impressions, 0) as impressions,\n coalesce(app_store_source_type.page_views, 0) as page_views,\n coalesce(downloads_source_type.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_source_type.redownloads, 0) as redownloads,\n coalesce(downloads_source_type.total_downloads, 0) as total_downloads,\n coalesce(usage_source_type.active_devices, 0) as active_devices,\n coalesce(usage_source_type.deletions, 0) as deletions,\n coalesce(usage_source_type.installations, 0) as installations,\n coalesce(usage_source_type.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_source_type\n on reporting_grain.date_day = app_store_source_type.date_day\n and reporting_grain.app_id = app_store_source_type.app_id \n and reporting_grain.source_type = app_store_source_type.source_type\n left join downloads_source_type\n on reporting_grain.date_day = downloads_source_type.date_day\n and reporting_grain.app_id = downloads_source_type.app_id \n and reporting_grain.source_type = downloads_source_type.source_type\n left join usage_source_type\n on reporting_grain.date_day = usage_source_type.date_day\n and reporting_grain.app_id = usage_source_type.app_id \n and reporting_grain.source_type = usage_source_type.source_type\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store.int_apple_store__app_store_source_type", "model.apple_store.int_apple_store__downloads_source_type", "model.apple_store.int_apple_store__usage_source_type"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__source_type_report"], "unique_id": "model.apple_store.apple_store__source_type_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__source_type_report.sql", "original_file_path": "models/apple_store__source_type_report.sql", "name": "apple_store__source_type_report", "alias": "apple_store__source_type_report", "checksum": {"name": "sha256", "checksum": "404c97952636bc68bfacfb3ed60d5de4bfc407ae6d21b7c5bc4030af29246039"}, "tags": [], "refs": [["stg_apple_store__app"], ["int_apple_store__app_store_source_type"], ["int_apple_store__downloads_source_type"], ["int_apple_store__usage_source_type"]], "sources": [], "description": "Each record represents daily metrics by app_id and source_type", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__source_type_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1654035147.296215, "compiled_sql": "with __dbt__cte__int_apple_store__app_store_source_type as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2,3\n)\n\nselect * \nfrom aggregated\n), __dbt__cte__int_apple_store__downloads_source_type as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2,3\n)\n\nselect * \nfrom aggregated\n), __dbt__cte__int_apple_store__usage_source_type as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2,3\n)\n\nselect * \nfrom aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_source_type as (\n\n select *\n from __dbt__cte__int_apple_store__app_store_source_type\n),\n\ndownloads_source_type as (\n\n select *\n from __dbt__cte__int_apple_store__downloads_source_type\n),\n\nusage_source_type as (\n\n select *\n from __dbt__cte__int_apple_store__usage_source_type\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type\n from app_store_source_type\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n coalesce(app_store_source_type.impressions, 0) as impressions,\n coalesce(app_store_source_type.page_views, 0) as page_views,\n coalesce(downloads_source_type.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_source_type.redownloads, 0) as redownloads,\n coalesce(downloads_source_type.total_downloads, 0) as total_downloads,\n coalesce(usage_source_type.active_devices, 0) as active_devices,\n coalesce(usage_source_type.deletions, 0) as deletions,\n coalesce(usage_source_type.installations, 0) as installations,\n coalesce(usage_source_type.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_source_type\n on reporting_grain.date_day = app_store_source_type.date_day\n and reporting_grain.app_id = app_store_source_type.app_id \n and reporting_grain.source_type = app_store_source_type.source_type\n left join downloads_source_type\n on reporting_grain.date_day = downloads_source_type.date_day\n and reporting_grain.app_id = downloads_source_type.app_id \n and reporting_grain.source_type = downloads_source_type.source_type\n left join usage_source_type\n on reporting_grain.date_day = usage_source_type.date_day\n and reporting_grain.app_id = usage_source_type.app_id \n and reporting_grain.source_type = usage_source_type.source_type\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__app_store_source_type", "sql": " __dbt__cte__int_apple_store__app_store_source_type as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2,3\n)\n\nselect * \nfrom aggregated\n)"}, {"id": "model.apple_store.int_apple_store__downloads_source_type", "sql": " __dbt__cte__int_apple_store__downloads_source_type as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2,3\n)\n\nselect * \nfrom aggregated\n)"}, {"id": "model.apple_store.int_apple_store__usage_source_type", "sql": " __dbt__cte__int_apple_store__usage_source_type as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2,3\n)\n\nselect * \nfrom aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__source_type_report`"}, "model.apple_store.apple_store__subscription_report": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith subscription_summary as (\n\n select *\n from {{ ref('int_apple_store__sales_subscription_summary') }}\n),\n\nsubscription_events as (\n\n select *\n from {{ ref('int_apple_store__sales_subscription_events') }}\n),\n\ncountry_codes as (\n \n select * \n from {{ var('apple_store_country_codes') }}\n),\n\nreporting_grain_combined as (\n\n select\n cast(date_day as date) as date_day,\n account_id,\n account_name,\n app_name,\n app_id,\n subscription_name,\n country,\n state \n from subscription_summary\n union all\n select\n cast(date_day as date) as date_day,\n account_id,\n account_name,\n app_name,\n app_id,\n subscription_name,\n country,\n state \n from subscription_events\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.account_id,\n reporting_grain.account_name, \n reporting_grain.app_id,\n reporting_grain.app_name,\n reporting_grain.subscription_name, \n case \n when country_codes.alternative_country_name is null then country_codes.country_name\n else country_codes.alternative_country_name\n end as territory_long,\n reporting_grain.country as territory_short,\n reporting_grain.state,\n country_codes.region, \n country_codes.sub_region,\n coalesce(subscription_summary.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_as_you_go_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce({{ 'subscription_events.' ~ event_column }}, 0)\n as {{ event_column }} \n {% endfor %}\n from reporting_grain\n left join subscription_summary\n on reporting_grain.date_day = subscription_summary.date_day\n and reporting_grain.account_id = subscription_summary.account_id \n and reporting_grain.app_name = subscription_summary.app_name\n and reporting_grain.subscription_name = subscription_summary.subscription_name\n and reporting_grain.country = subscription_summary.country\n and reporting_grain.state = subscription_summary.state\n left join subscription_events\n on reporting_grain.date_day = subscription_events.date_day\n and reporting_grain.account_id = subscription_events.account_id \n and reporting_grain.app_name = subscription_events.app_name\n and reporting_grain.subscription_name = subscription_events.subscription_name\n and reporting_grain.country = subscription_events.country\n and reporting_grain.state = subscription_events.state\n left join country_codes\n on reporting_grain.country = country_codes.country_code_alpha_2\n \n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store.int_apple_store__sales_subscription_summary", "model.apple_store.int_apple_store__sales_subscription_events", "seed.apple_store_source.apple_store_country_codes"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__subscription_report"], "unique_id": "model.apple_store.apple_store__subscription_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__subscription_report.sql", "original_file_path": "models/apple_store__subscription_report.sql", "name": "apple_store__subscription_report", "alias": "apple_store__subscription_report", "checksum": {"name": "sha256", "checksum": "61cfe7b6efa67c30d404c5bb48bfc2e3c885110c14dd1178aa12a33cdc744bd0"}, "tags": [], "refs": [["int_apple_store__sales_subscription_summary"], ["int_apple_store__sales_subscription_events"], ["apple_store_country_codes"]], "sources": [], "description": "Each record represents daily subscription metrics by account, app, subscription name, country and state", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Sales Account Name associated with the Sales Account ID, app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country_name": {"name": "country_name", "description": "The ISO-3166 English country name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region": {"name": "region", "description": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region": {"name": "sub_region", "description": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory_long": {"name": "territory_long", "description": "The territory (aka country) full name associated with the report's respective metric(s). Territory_long uses source territories for the following: downloads, usage and app store; territory_long is inferred from ISO-3166 using the 2-character country code for subscription events and subscription summary. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__subscription_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store", "enabled": true}, "created_at": 1654035147.280816, "compiled_sql": "\n\nwith __dbt__cte__int_apple_store__sales_subscription_summary as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_apple_store__sales_subscription_events as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined\n),subscription_summary as (\n\n select *\n from __dbt__cte__int_apple_store__sales_subscription_summary\n),\n\nsubscription_events as (\n\n select *\n from __dbt__cte__int_apple_store__sales_subscription_events\n),\n\ncountry_codes as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`apple_store_country_codes`\n),\n\nreporting_grain_combined as (\n\n select\n cast(date_day as date) as date_day,\n account_id,\n account_name,\n app_name,\n app_id,\n subscription_name,\n country,\n state \n from subscription_summary\n union all\n select\n cast(date_day as date) as date_day,\n account_id,\n account_name,\n app_name,\n app_id,\n subscription_name,\n country,\n state \n from subscription_events\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.account_id,\n reporting_grain.account_name, \n reporting_grain.app_id,\n reporting_grain.app_name,\n reporting_grain.subscription_name, \n case \n when country_codes.alternative_country_name is null then country_codes.country_name\n else country_codes.alternative_country_name\n end as territory_long,\n reporting_grain.country as territory_short,\n reporting_grain.state,\n country_codes.region, \n country_codes.sub_region,\n coalesce(subscription_summary.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_as_you_go_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscription_summary.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n \n \n , coalesce(subscription_events.event_renew, 0)\n as event_renew \n \n \n , coalesce(subscription_events.event_cancel, 0)\n as event_cancel \n \n \n , coalesce(subscription_events.event_subscribe, 0)\n as event_subscribe \n \n from reporting_grain\n left join subscription_summary\n on reporting_grain.date_day = subscription_summary.date_day\n and reporting_grain.account_id = subscription_summary.account_id \n and reporting_grain.app_name = subscription_summary.app_name\n and reporting_grain.subscription_name = subscription_summary.subscription_name\n and reporting_grain.country = subscription_summary.country\n and reporting_grain.state = subscription_summary.state\n left join subscription_events\n on reporting_grain.date_day = subscription_events.date_day\n and reporting_grain.account_id = subscription_events.account_id \n and reporting_grain.app_name = subscription_events.app_name\n and reporting_grain.subscription_name = subscription_events.subscription_name\n and reporting_grain.country = subscription_events.country\n and reporting_grain.state = subscription_events.state\n left join country_codes\n on reporting_grain.country = country_codes.country_code_alpha_2\n \n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__sales_subscription_summary", "sql": " __dbt__cte__int_apple_store__sales_subscription_summary as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.apple_store.int_apple_store__sales_subscription_events", "sql": " __dbt__cte__int_apple_store__sales_subscription_events as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__subscription_report`"}, "model.apple_store.apple_store__platform_version_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_platform_version as (\n \n select *\n from {{ var('app_store_platform_version') }}\n),\n\ncrashes_platform_version as (\n \n select *\n from {{ ref('int_apple_store__platform_version') }}\n),\n\ndownloads_platform_version as (\n\n select *\n from {{ var('downloads_platform_version') }}\n),\n\nusage_platform_version as (\n\n select *\n from {{ var('usage_platform_version') }}\n),\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n platform_version\n from app_store_platform_version\n union all\n select \n date_day,\n app_id,\n source_type,\n platform_version\n from crashes_platform_version\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.platform_version,\n coalesce(app_store_platform_version.impressions, 0) as impressions,\n coalesce(app_store_platform_version.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_platform_version.page_views, 0) as page_views,\n coalesce(app_store_platform_version.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_platform_version.crashes, 0) as crashes,\n coalesce(downloads_platform_version.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_platform_version.redownloads, 0) as redownloads,\n coalesce(downloads_platform_version.total_downloads, 0) as total_downloads,\n coalesce(usage_platform_version.active_devices, 0) as active_devices,\n coalesce(usage_platform_version.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_platform_version.deletions, 0) as deletions,\n coalesce(usage_platform_version.installations, 0) as installations,\n coalesce(usage_platform_version.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_platform_version \n on reporting_grain.date_day = app_store_platform_version.date_day\n and reporting_grain.app_id = app_store_platform_version.app_id \n and reporting_grain.source_type = app_store_platform_version.source_type\n and reporting_grain.platform_version = app_store_platform_version.platform_version\n left join crashes_platform_version\n on reporting_grain.date_day = crashes_platform_version.date_day\n and reporting_grain.app_id = crashes_platform_version.app_id\n and reporting_grain.source_type = crashes_platform_version.source_type\n and reporting_grain.platform_version = crashes_platform_version.platform_version \n left join downloads_platform_version\n on reporting_grain.date_day = downloads_platform_version.date_day\n and reporting_grain.app_id = downloads_platform_version.app_id \n and reporting_grain.source_type = downloads_platform_version.source_type\n and reporting_grain.platform_version = downloads_platform_version.platform_version\n left join usage_platform_version\n on reporting_grain.date_day = usage_platform_version.date_day\n and reporting_grain.app_id = usage_platform_version.app_id \n and reporting_grain.source_type = usage_platform_version.source_type\n and reporting_grain.platform_version = usage_platform_version.platform_version\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_platform_version", "model.apple_store.int_apple_store__platform_version", "model.apple_store_source.stg_apple_store__downloads_platform_version", "model.apple_store_source.stg_apple_store__usage_platform_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__platform_version_report"], "unique_id": "model.apple_store.apple_store__platform_version_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__platform_version_report.sql", "original_file_path": "models/apple_store__platform_version_report.sql", "name": "apple_store__platform_version_report", "alias": "apple_store__platform_version_report", "checksum": {"name": "sha256", "checksum": "3b5d9f9996f4ec8fc47f4326f8b334063444784410f933ac0be56eee4c46a79e"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__app_store_platform_version"], ["int_apple_store__platform_version"], ["stg_apple_store__downloads_platform_version"], ["stg_apple_store__usage_platform_version"]], "sources": [], "description": "Each record represents daily metrics for each by app_id, source_type and platform version", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__platform_version_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1654035147.305996, "compiled_sql": "with __dbt__cte__int_apple_store__platform_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_platform_version as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version`\n),\n\ncrashes_platform_version as (\n \n select *\n from __dbt__cte__int_apple_store__platform_version\n),\n\ndownloads_platform_version as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version`\n),\n\nusage_platform_version as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version`\n),\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n platform_version\n from app_store_platform_version\n union all\n select \n date_day,\n app_id,\n source_type,\n platform_version\n from crashes_platform_version\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.platform_version,\n coalesce(app_store_platform_version.impressions, 0) as impressions,\n coalesce(app_store_platform_version.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_platform_version.page_views, 0) as page_views,\n coalesce(app_store_platform_version.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_platform_version.crashes, 0) as crashes,\n coalesce(downloads_platform_version.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_platform_version.redownloads, 0) as redownloads,\n coalesce(downloads_platform_version.total_downloads, 0) as total_downloads,\n coalesce(usage_platform_version.active_devices, 0) as active_devices,\n coalesce(usage_platform_version.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_platform_version.deletions, 0) as deletions,\n coalesce(usage_platform_version.installations, 0) as installations,\n coalesce(usage_platform_version.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_platform_version \n on reporting_grain.date_day = app_store_platform_version.date_day\n and reporting_grain.app_id = app_store_platform_version.app_id \n and reporting_grain.source_type = app_store_platform_version.source_type\n and reporting_grain.platform_version = app_store_platform_version.platform_version\n left join crashes_platform_version\n on reporting_grain.date_day = crashes_platform_version.date_day\n and reporting_grain.app_id = crashes_platform_version.app_id\n and reporting_grain.source_type = crashes_platform_version.source_type\n and reporting_grain.platform_version = crashes_platform_version.platform_version \n left join downloads_platform_version\n on reporting_grain.date_day = downloads_platform_version.date_day\n and reporting_grain.app_id = downloads_platform_version.app_id \n and reporting_grain.source_type = downloads_platform_version.source_type\n and reporting_grain.platform_version = downloads_platform_version.platform_version\n left join usage_platform_version\n on reporting_grain.date_day = usage_platform_version.date_day\n and reporting_grain.app_id = usage_platform_version.app_id \n and reporting_grain.source_type = usage_platform_version.source_type\n and reporting_grain.platform_version = usage_platform_version.platform_version\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__platform_version", "sql": " __dbt__cte__int_apple_store__platform_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__platform_version_report`"}, "model.apple_store.apple_store__territory_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_territory as (\n\n select *\n from {{ var('app_store_territory') }}\n),\n\ncountry_codes as (\n\n select * \n from {{ var('apple_store_country_codes') }}\n),\n\ndownloads_territory as (\n\n select *\n from {{ var('downloads_territory') }}\n),\n\nusage_territory as (\n\n select * \n from {{ var('usage_territory') }}\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type,\n territory \n from app_store_territory\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n reporting_grain.source_type,\n reporting_grain.territory as territory_long,\n coalesce(official_country_codes.country_code_alpha_2, alternative_country_codes.country_code_alpha_2) as territory_short,\n coalesce(official_country_codes.region, alternative_country_codes.region) as region,\n coalesce(official_country_codes.sub_region, alternative_country_codes.sub_region) as sub_region,\n coalesce(app_store_territory.impressions, 0) as impressions,\n coalesce(app_store_territory.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_territory.page_views, 0) as page_views,\n coalesce(app_store_territory.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(downloads_territory.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_territory.redownloads, 0) as redownloads,\n coalesce(downloads_territory.total_downloads, 0) as total_downloads,\n coalesce(usage_territory.active_devices, 0) as active_devices,\n coalesce(usage_territory.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_territory.deletions, 0) as deletions,\n coalesce(usage_territory.installations, 0) as installations,\n coalesce(usage_territory.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_territory \n on reporting_grain.date_day = app_store_territory.date_day\n and reporting_grain.app_id = app_store_territory.app_id \n and reporting_grain.source_type = app_store_territory.source_type\n and reporting_grain.territory = app_store_territory.territory\n left join downloads_territory\n on reporting_grain.date_day = downloads_territory.date_day\n and reporting_grain.app_id = downloads_territory.app_id \n and reporting_grain.source_type = downloads_territory.source_type\n and reporting_grain.territory = downloads_territory.territory\n left join usage_territory\n on reporting_grain.date_day = usage_territory.date_day\n and reporting_grain.app_id = usage_territory.app_id \n and reporting_grain.source_type = usage_territory.source_type\n and reporting_grain.territory = usage_territory.territory\n left join country_codes as official_country_codes\n on reporting_grain.territory = official_country_codes.country_name\n left join country_codes as alternative_country_codes\n on reporting_grain.territory = alternative_country_codes.alternative_country_name\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_territory", "seed.apple_store_source.apple_store_country_codes", "model.apple_store_source.stg_apple_store__downloads_territory", "model.apple_store_source.stg_apple_store__usage_territory"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__territory_report"], "unique_id": "model.apple_store.apple_store__territory_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__territory_report.sql", "original_file_path": "models/apple_store__territory_report.sql", "name": "apple_store__territory_report", "alias": "apple_store__territory_report", "checksum": {"name": "sha256", "checksum": "666610fa4dc14507b48b930e373b7410714906fc8db4a7e94ba759e2af4e16a1"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__app_store_territory"], ["apple_store_country_codes"], ["stg_apple_store__downloads_territory"], ["stg_apple_store__usage_territory"]], "sources": [], "description": "Each record represents daily subscription metrics by app_id, source_type and territory", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory_long": {"name": "territory_long", "description": "The territory (aka country) full name associated with the report's respective metric(s). Territory_long uses source territories for the following: downloads, usage and app store; territory_long is inferred from ISO-3166 using the 2-character country code for subscription events and subscription summary. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory_short": {"name": "territory_short", "description": "The 2-character country code associated with the report's respective metric(s). Territory_short uses source 2-character country codes for the subscription events and subscription summary; territory_short is inferred from ISO-3166 using source territories for the following: downloads, usage and app store. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "region": {"name": "region", "description": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_region": {"name": "sub_region", "description": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__territory_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1654035147.286756, "compiled_sql": "with app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_territory as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory`\n),\n\ncountry_codes as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`apple_store_country_codes`\n),\n\ndownloads_territory as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory`\n),\n\nusage_territory as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory`\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id,\n source_type,\n territory \n from app_store_territory\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n reporting_grain.source_type,\n reporting_grain.territory as territory_long,\n coalesce(official_country_codes.country_code_alpha_2, alternative_country_codes.country_code_alpha_2) as territory_short,\n coalesce(official_country_codes.region, alternative_country_codes.region) as region,\n coalesce(official_country_codes.sub_region, alternative_country_codes.sub_region) as sub_region,\n coalesce(app_store_territory.impressions, 0) as impressions,\n coalesce(app_store_territory.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_territory.page_views, 0) as page_views,\n coalesce(app_store_territory.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(downloads_territory.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_territory.redownloads, 0) as redownloads,\n coalesce(downloads_territory.total_downloads, 0) as total_downloads,\n coalesce(usage_territory.active_devices, 0) as active_devices,\n coalesce(usage_territory.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_territory.deletions, 0) as deletions,\n coalesce(usage_territory.installations, 0) as installations,\n coalesce(usage_territory.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_territory \n on reporting_grain.date_day = app_store_territory.date_day\n and reporting_grain.app_id = app_store_territory.app_id \n and reporting_grain.source_type = app_store_territory.source_type\n and reporting_grain.territory = app_store_territory.territory\n left join downloads_territory\n on reporting_grain.date_day = downloads_territory.date_day\n and reporting_grain.app_id = downloads_territory.app_id \n and reporting_grain.source_type = downloads_territory.source_type\n and reporting_grain.territory = downloads_territory.territory\n left join usage_territory\n on reporting_grain.date_day = usage_territory.date_day\n and reporting_grain.app_id = usage_territory.app_id \n and reporting_grain.source_type = usage_territory.source_type\n and reporting_grain.territory = usage_territory.territory\n left join country_codes as official_country_codes\n on reporting_grain.territory = official_country_codes.country_name\n left join country_codes as alternative_country_codes\n on reporting_grain.territory = alternative_country_codes.alternative_country_name\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__territory_report`"}, "model.apple_store.apple_store__device_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store_device as (\n\n select *\n from {{ var('app_store_device') }}\n),\n\ndownloads_device as (\n\n select *\n from {{ var('downloads_device') }}\n),\n\nusage_device as (\n\n select *\n from {{ var('usage_device') }}\n),\n\ncrashes_device as (\n\n select *\n from {{ ref('int_apple_store__crashes_device') }}\n),\n\n{% if var('apple_store__using_subscriptions', False) %}\nsubscription_device as (\n\n select *\n from {{ ref('int_apple_store__subscription_device') }}\n),\n{% endif %}\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n device \n from app_store_device\n union all\n select\n date_day,\n app_id,\n source_type,\n device\n from crashes_device\n),\n\nreporting_grain as (\n \n select\n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.device,\n coalesce(app_store_device.impressions, 0) as impressions,\n coalesce(app_store_device.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_device.page_views, 0) as page_views,\n coalesce(app_store_device.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_device.crashes, 0) as crashes,\n coalesce(downloads_device.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_device.redownloads, 0) as redownloads,\n coalesce(downloads_device.total_downloads, 0) as total_downloads,\n coalesce(usage_device.active_devices, 0) as active_devices,\n coalesce(usage_device.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_device.deletions, 0) as deletions,\n coalesce(usage_device.installations, 0) as installations,\n coalesce(usage_device.sessions, 0) as sessions\n {% if var('apple_store__using_subscriptions', False) %}\n ,\n coalesce(subscription_device.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscription_device.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_a_you_go_introductory_offer_subscriptions,\n coalesce(subscription_device.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscription_device.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce({{ 'subscription_device.' ~ event_column }}, 0)\n as {{ event_column }} \n {% endfor %}\n {% endif %}\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_device \n on reporting_grain.date_day = app_store_device.date_day\n and reporting_grain.app_id = app_store_device.app_id \n and reporting_grain.source_type = app_store_device.source_type\n and reporting_grain.device = app_store_device.device\n left join crashes_device\n on reporting_grain.date_day = crashes_device.date_day\n and reporting_grain.app_id = crashes_device.app_id\n and reporting_grain.source_type = crashes_device.source_type\n and reporting_grain.device = crashes_device.device\n left join downloads_device\n on reporting_grain.date_day = downloads_device.date_day\n and reporting_grain.app_id = downloads_device.app_id \n and reporting_grain.source_type = downloads_device.source_type\n and reporting_grain.device = downloads_device.device\n {% if var('apple_store__using_subscriptions', False) %}\n left join subscription_device\n on reporting_grain.date_day = subscription_device.date_day\n and reporting_grain.app_id = subscription_device.app_id \n and reporting_grain.source_type = subscription_device.source_type\n and reporting_grain.device = subscription_device.device\n {% endif %}\n left join usage_device\n on reporting_grain.date_day = usage_device.date_day\n and reporting_grain.app_id = usage_device.app_id \n and reporting_grain.source_type = usage_device.source_type\n and reporting_grain.device = usage_device.device\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_device", "model.apple_store_source.stg_apple_store__downloads_device", "model.apple_store_source.stg_apple_store__usage_device", "model.apple_store.int_apple_store__crashes_device", "model.apple_store.int_apple_store__subscription_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__device_report"], "unique_id": "model.apple_store.apple_store__device_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__device_report.sql", "original_file_path": "models/apple_store__device_report.sql", "name": "apple_store__device_report", "alias": "apple_store__device_report", "checksum": {"name": "sha256", "checksum": "b7c5ecd862c8e29a83fa71ea1c1fcfe9cfd90d7b9d56ffdc93e96d9ec0560b7f"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__app_store_device"], ["stg_apple_store__downloads_device"], ["stg_apple_store__usage_device"], ["int_apple_store__crashes_device"], ["int_apple_store__subscription_device"]], "sources": [], "description": "Each record represents daily subscription metrics by app_id, source_type and device", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__device_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1654035147.2921338, "compiled_sql": "with __dbt__cte__int_apple_store__crashes_device as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated\n), __dbt__cte__int_apple_store__subscription_device as (\n\n\nwith app as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsubscription_summary as (\n\n select\n date_day,\n app_name,\n device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n group by 1,2,3\n), \n\nfiltered_subscription_events as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events` \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted_subscription_events as (\n \n select\n date_day\n , app_name\n , device\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered_subscription_events\n group by 1,2,3\n),\n\njoined as (\n\n select \n app.app_id,\n pivoted_subscription_events.*,\n subscription_summary.active_free_trial_introductory_offer_subscriptions,\n subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions,\n subscription_summary.active_pay_up_front_introductory_offer_subscriptions,\n subscription_summary.active_standard_price_subscriptions,\n cast(null as \n string\n) as source_type\n from subscription_summary \n left join pivoted_subscription_events\n on subscription_summary.date_day = pivoted_subscription_events.date_day\n and subscription_summary.app_name = pivoted_subscription_events.app_name\n and subscription_summary.device = pivoted_subscription_events.device\n left join app \n on subscription_summary.app_name = app.app_name\n)\n\nselect * \nfrom joined\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store_device as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\ndownloads_device as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\nusage_device as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\ncrashes_device as (\n\n select *\n from __dbt__cte__int_apple_store__crashes_device\n),\n\n\nsubscription_device as (\n\n select *\n from __dbt__cte__int_apple_store__subscription_device\n),\n\n\nreporting_grain_combined as (\n\n select\n date_day,\n app_id,\n source_type,\n device \n from app_store_device\n union all\n select\n date_day,\n app_id,\n source_type,\n device\n from crashes_device\n),\n\nreporting_grain as (\n \n select\n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.device,\n coalesce(app_store_device.impressions, 0) as impressions,\n coalesce(app_store_device.impressions_unique_device, 0) as impressions_unique_device,\n coalesce(app_store_device.page_views, 0) as page_views,\n coalesce(app_store_device.page_views_unique_device, 0) as page_views_unique_device,\n coalesce(crashes_device.crashes, 0) as crashes,\n coalesce(downloads_device.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads_device.redownloads, 0) as redownloads,\n coalesce(downloads_device.total_downloads, 0) as total_downloads,\n coalesce(usage_device.active_devices, 0) as active_devices,\n coalesce(usage_device.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_device.deletions, 0) as deletions,\n coalesce(usage_device.installations, 0) as installations,\n coalesce(usage_device.sessions, 0) as sessions\n \n ,\n coalesce(subscription_device.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscription_device.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_a_you_go_introductory_offer_subscriptions,\n coalesce(subscription_device.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscription_device.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n \n \n , coalesce(subscription_device.event_renew, 0)\n as event_renew \n \n \n , coalesce(subscription_device.event_cancel, 0)\n as event_cancel \n \n \n , coalesce(subscription_device.event_subscribe, 0)\n as event_subscribe \n \n \n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store_device \n on reporting_grain.date_day = app_store_device.date_day\n and reporting_grain.app_id = app_store_device.app_id \n and reporting_grain.source_type = app_store_device.source_type\n and reporting_grain.device = app_store_device.device\n left join crashes_device\n on reporting_grain.date_day = crashes_device.date_day\n and reporting_grain.app_id = crashes_device.app_id\n and reporting_grain.source_type = crashes_device.source_type\n and reporting_grain.device = crashes_device.device\n left join downloads_device\n on reporting_grain.date_day = downloads_device.date_day\n and reporting_grain.app_id = downloads_device.app_id \n and reporting_grain.source_type = downloads_device.source_type\n and reporting_grain.device = downloads_device.device\n \n left join subscription_device\n on reporting_grain.date_day = subscription_device.date_day\n and reporting_grain.app_id = subscription_device.app_id \n and reporting_grain.source_type = subscription_device.source_type\n and reporting_grain.device = subscription_device.device\n \n left join usage_device\n on reporting_grain.date_day = usage_device.date_day\n and reporting_grain.app_id = usage_device.app_id \n and reporting_grain.source_type = usage_device.source_type\n and reporting_grain.device = usage_device.device\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__crashes_device", "sql": " __dbt__cte__int_apple_store__crashes_device as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated\n)"}, {"id": "model.apple_store.int_apple_store__subscription_device", "sql": " __dbt__cte__int_apple_store__subscription_device as (\n\n\nwith app as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsubscription_summary as (\n\n select\n date_day,\n app_name,\n device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n group by 1,2,3\n), \n\nfiltered_subscription_events as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events` \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted_subscription_events as (\n \n select\n date_day\n , app_name\n , device\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered_subscription_events\n group by 1,2,3\n),\n\njoined as (\n\n select \n app.app_id,\n pivoted_subscription_events.*,\n subscription_summary.active_free_trial_introductory_offer_subscriptions,\n subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions,\n subscription_summary.active_pay_up_front_introductory_offer_subscriptions,\n subscription_summary.active_standard_price_subscriptions,\n cast(null as \n string\n) as source_type\n from subscription_summary \n left join pivoted_subscription_events\n on subscription_summary.date_day = pivoted_subscription_events.date_day\n and subscription_summary.app_name = pivoted_subscription_events.app_name\n and subscription_summary.device = pivoted_subscription_events.device\n left join app \n on subscription_summary.app_name = app.app_name\n)\n\nselect * \nfrom joined\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__device_report`"}, "model.apple_store.apple_store__app_version_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\ncrashes_app_version_report as (\n \n select *\n from {{ ref('int_apple_store__crashes_app_version') }}\n),\n\nusage_app_version_report as (\n\n select *\n from {{ var('usage_app_version') }}\n),\n\nreporting_grain_combined as (\n \n select\n date_day,\n app_id,\n source_type,\n app_version\n from usage_app_version_report\n union all \n select \n date_day,\n app_id,\n source_type,\n app_version\n from crashes_app_version_report\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.app_version,\n coalesce(crashes_app_version_report.crashes, 0) as crashes,\n coalesce(usage_app_version_report.active_devices, 0) as active_devices,\n coalesce(usage_app_version_report.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_app_version_report.deletions, 0) as deletions,\n coalesce(usage_app_version_report.installations, 0) as installations,\n coalesce(usage_app_version_report.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join crashes_app_version_report\n on reporting_grain.date_day = crashes_app_version_report.date_day\n and reporting_grain.app_id = crashes_app_version_report.app_id\n and reporting_grain.source_type = crashes_app_version_report.source_type\n and reporting_grain.app_version = crashes_app_version_report.app_version\n left join usage_app_version_report\n on reporting_grain.date_day = usage_app_version_report.date_day\n and reporting_grain.app_id = usage_app_version_report.app_id \n and reporting_grain.source_type = usage_app_version_report.source_type\n and reporting_grain.app_version = usage_app_version_report.app_version\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store.int_apple_store__crashes_app_version", "model.apple_store_source.stg_apple_store__usage_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__app_version_report"], "unique_id": "model.apple_store.apple_store__app_version_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__app_version_report.sql", "original_file_path": "models/apple_store__app_version_report.sql", "name": "apple_store__app_version_report", "alias": "apple_store__app_version_report", "checksum": {"name": "sha256", "checksum": "83cd548704cd77e13984f665807ee6f3f9536618db94096c297cda876f0cc730"}, "tags": [], "refs": [["stg_apple_store__app"], ["int_apple_store__crashes_app_version"], ["stg_apple_store__usage_app_version"]], "sources": [], "description": "Each record represents daily metrics for each by app_id, source_type and app version", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__app_version_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1654035147.31144, "compiled_sql": "with __dbt__cte__int_apple_store__crashes_app_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\ncrashes_app_version_report as (\n \n select *\n from __dbt__cte__int_apple_store__crashes_app_version\n),\n\nusage_app_version_report as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version`\n),\n\nreporting_grain_combined as (\n \n select\n date_day,\n app_id,\n source_type,\n app_version\n from usage_app_version_report\n union all \n select \n date_day,\n app_id,\n source_type,\n app_version\n from crashes_app_version_report\n),\n\nreporting_grain as (\n\n select \n distinct *\n from reporting_grain_combined\n),\n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id, \n app.app_name,\n reporting_grain.source_type,\n reporting_grain.app_version,\n coalesce(crashes_app_version_report.crashes, 0) as crashes,\n coalesce(usage_app_version_report.active_devices, 0) as active_devices,\n coalesce(usage_app_version_report.active_devices_last_30_days, 0) as active_devices_last_30_days,\n coalesce(usage_app_version_report.deletions, 0) as deletions,\n coalesce(usage_app_version_report.installations, 0) as installations,\n coalesce(usage_app_version_report.sessions, 0) as sessions\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join crashes_app_version_report\n on reporting_grain.date_day = crashes_app_version_report.date_day\n and reporting_grain.app_id = crashes_app_version_report.app_id\n and reporting_grain.source_type = crashes_app_version_report.source_type\n and reporting_grain.app_version = crashes_app_version_report.app_version\n left join usage_app_version_report\n on reporting_grain.date_day = usage_app_version_report.date_day\n and reporting_grain.app_id = usage_app_version_report.app_id \n and reporting_grain.source_type = usage_app_version_report.source_type\n and reporting_grain.app_version = usage_app_version_report.app_version\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__crashes_app_version", "sql": " __dbt__cte__int_apple_store__crashes_app_version as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__app_version_report`"}, "model.apple_store.apple_store__overview_report": {"raw_sql": "with app as (\n\n select * \n from {{ var('app') }}\n),\n\napp_store as (\n\n select *\n from {{ ref('int_apple_store__app_store_overview') }}\n),\n\ncrashes as (\n\n select *\n from {{ ref('int_apple_store__crashes_overview') }}\n),\n\ndownloads as (\n\n select *\n from {{ ref('int_apple_store__downloads_overview') }}\n),\n\n{% if var('apple_store__using_subscriptions', False) %}\nsubscriptions as (\n\n select *\n from {{ ref('int_apple_store__sales_subscription_overview') }}\n), \n{% endif %}\n\nusage as (\n\n select *\n from {{ ref('int_apple_store__usage_overview') }}\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id \n from app_store\n), \n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n coalesce(app_store.impressions, 0) as impressions,\n coalesce(app_store.page_views, 0) as page_views,\n coalesce(crashes.crashes,0) as crashes,\n coalesce(downloads.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads.redownloads, 0) as redownloads,\n coalesce(downloads.total_downloads, 0) as total_downloads,\n coalesce(usage.active_devices, 0) as active_devices,\n coalesce(usage.deletions, 0) as deletions,\n coalesce(usage.installations, 0) as installations,\n coalesce(usage.sessions, 0) as sessions\n {% if var('apple_store__using_subscriptions', False) %}\n ,\n coalesce(subscriptions.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscriptions.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_as_you_go_introductory_offer_subscriptions,\n coalesce(subscriptions.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscriptions.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce({{ 'subscriptions.' ~ event_column }}, 0)\n as {{ event_column }} \n {% endfor %}\n {% endif %}\n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store \n on reporting_grain.date_day = app_store.date_day\n and reporting_grain.app_id = app_store.app_id\n left join crashes\n on reporting_grain.date_day = crashes.date_day\n and reporting_grain.app_id = crashes.app_id\n left join downloads\n on reporting_grain.date_day = downloads.date_day\n and reporting_grain.app_id = downloads.app_id\n {% if var('apple_store__using_subscriptions', False) %}\n left join subscriptions \n on reporting_grain.date_day = subscriptions.date_day\n and reporting_grain.app_id = subscriptions.app_id\n {% endif %}\n left join usage\n on reporting_grain.date_day = usage.date_day\n and reporting_grain.app_id = usage.app_id \n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store.int_apple_store__app_store_overview", "model.apple_store.int_apple_store__crashes_overview", "model.apple_store.int_apple_store__downloads_overview", "model.apple_store.int_apple_store__sales_subscription_overview", "model.apple_store.int_apple_store__usage_overview"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "apple_store__overview_report"], "unique_id": "model.apple_store.apple_store__overview_report", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "apple_store__overview_report.sql", "original_file_path": "models/apple_store__overview_report.sql", "name": "apple_store__overview_report", "alias": "apple_store__overview_report", "checksum": {"name": "sha256", "checksum": "5adbb565c27d0219a6ad4e166d3a88e13d9378e840853cf1a8f3c5879f518ee0"}, "tags": [], "refs": [["stg_apple_store__app"], ["int_apple_store__app_store_overview"], ["int_apple_store__crashes_overview"], ["int_apple_store__downloads_overview"], ["int_apple_store__sales_subscription_overview"], ["int_apple_store__usage_overview"]], "sources": [], "description": "Each record represents daily metrics for each app_id", "columns": {"date_day": {"name": "date_day", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "apple_store://models/apple_store.yml", "compiled_path": "target/compiled/apple_store/models/apple_store__overview_report.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "apple_store"}, "created_at": 1654035147.300574, "compiled_sql": "with __dbt__cte__int_apple_store__app_store_overview as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2\n)\n\nselect * \nfrom aggregated\n), __dbt__cte__int_apple_store__crashes_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n group by 1,2\n)\n\nselect * \nfrom aggregated\n), __dbt__cte__int_apple_store__downloads_overview as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2\n)\n\nselect * \nfrom aggregated\n), __dbt__cte__int_apple_store__sales_subscription_summary as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_apple_store__sales_subscription_events as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_apple_store__sales_subscription_overview as (\n\n\nwith subscription_summary as (\n\n select\n date_day,\n app_id,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from __dbt__cte__int_apple_store__sales_subscription_summary\n group by 1,2\n), \n\nsubscription_events as (\n\n select \n date_day,\n app_id\n \n \n , coalesce(sum(event_renew), 0)\n as event_renew \n \n \n , coalesce(sum(event_cancel), 0)\n as event_cancel \n \n \n , coalesce(sum(event_subscribe), 0)\n as event_subscribe \n \n from __dbt__cte__int_apple_store__sales_subscription_events\n group by 1,2\n), \n\njoined as (\n\n select \n subscription_events.*,\n active_free_trial_introductory_offer_subscriptions,\n active_pay_as_you_go_introductory_offer_subscriptions,\n active_pay_up_front_introductory_offer_subscriptions,\n active_standard_price_subscriptions\n from subscription_summary \n left join subscription_events\n on subscription_summary.date_day = subscription_events.date_day\n and subscription_summary.app_id = subscription_events.app_id \n)\n\nselect * \nfrom joined\n), __dbt__cte__int_apple_store__usage_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2\n)\n\nselect * \nfrom aggregated\n),app as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\napp_store as (\n\n select *\n from __dbt__cte__int_apple_store__app_store_overview\n),\n\ncrashes as (\n\n select *\n from __dbt__cte__int_apple_store__crashes_overview\n),\n\ndownloads as (\n\n select *\n from __dbt__cte__int_apple_store__downloads_overview\n),\n\n\nsubscriptions as (\n\n select *\n from __dbt__cte__int_apple_store__sales_subscription_overview\n), \n\n\nusage as (\n\n select *\n from __dbt__cte__int_apple_store__usage_overview\n),\n\nreporting_grain as (\n\n select distinct\n date_day,\n app_id \n from app_store\n), \n\njoined as (\n\n select \n reporting_grain.date_day,\n reporting_grain.app_id,\n app.app_name,\n coalesce(app_store.impressions, 0) as impressions,\n coalesce(app_store.page_views, 0) as page_views,\n coalesce(crashes.crashes,0) as crashes,\n coalesce(downloads.first_time_downloads, 0) as first_time_downloads,\n coalesce(downloads.redownloads, 0) as redownloads,\n coalesce(downloads.total_downloads, 0) as total_downloads,\n coalesce(usage.active_devices, 0) as active_devices,\n coalesce(usage.deletions, 0) as deletions,\n coalesce(usage.installations, 0) as installations,\n coalesce(usage.sessions, 0) as sessions\n \n ,\n coalesce(subscriptions.active_free_trial_introductory_offer_subscriptions, 0) as active_free_trial_introductory_offer_subscriptions,\n coalesce(subscriptions.active_pay_as_you_go_introductory_offer_subscriptions, 0) as active_pay_as_you_go_introductory_offer_subscriptions,\n coalesce(subscriptions.active_pay_up_front_introductory_offer_subscriptions, 0) as active_pay_up_front_introductory_offer_subscriptions,\n coalesce(subscriptions.active_standard_price_subscriptions, 0) as active_standard_price_subscriptions\n \n \n , coalesce(subscriptions.event_renew, 0)\n as event_renew \n \n \n , coalesce(subscriptions.event_cancel, 0)\n as event_cancel \n \n \n , coalesce(subscriptions.event_subscribe, 0)\n as event_subscribe \n \n \n from reporting_grain\n left join app \n on reporting_grain.app_id = app.app_id\n left join app_store \n on reporting_grain.date_day = app_store.date_day\n and reporting_grain.app_id = app_store.app_id\n left join crashes\n on reporting_grain.date_day = crashes.date_day\n and reporting_grain.app_id = crashes.app_id\n left join downloads\n on reporting_grain.date_day = downloads.date_day\n and reporting_grain.app_id = downloads.app_id\n \n left join subscriptions \n on reporting_grain.date_day = subscriptions.date_day\n and reporting_grain.app_id = subscriptions.app_id\n \n left join usage\n on reporting_grain.date_day = usage.date_day\n and reporting_grain.app_id = usage.app_id \n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__app_store_overview", "sql": " __dbt__cte__int_apple_store__app_store_overview as (\nwith base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2\n)\n\nselect * \nfrom aggregated\n)"}, {"id": "model.apple_store.int_apple_store__crashes_overview", "sql": " __dbt__cte__int_apple_store__crashes_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n group by 1,2\n)\n\nselect * \nfrom aggregated\n)"}, {"id": "model.apple_store.int_apple_store__downloads_overview", "sql": " __dbt__cte__int_apple_store__downloads_overview as (\nwith base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2\n)\n\nselect * \nfrom aggregated\n)"}, {"id": "model.apple_store.int_apple_store__sales_subscription_summary", "sql": " __dbt__cte__int_apple_store__sales_subscription_summary as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.apple_store.int_apple_store__sales_subscription_events", "sql": " __dbt__cte__int_apple_store__sales_subscription_events as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.apple_store.int_apple_store__sales_subscription_overview", "sql": " __dbt__cte__int_apple_store__sales_subscription_overview as (\n\n\nwith subscription_summary as (\n\n select\n date_day,\n app_id,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from __dbt__cte__int_apple_store__sales_subscription_summary\n group by 1,2\n), \n\nsubscription_events as (\n\n select \n date_day,\n app_id\n \n \n , coalesce(sum(event_renew), 0)\n as event_renew \n \n \n , coalesce(sum(event_cancel), 0)\n as event_cancel \n \n \n , coalesce(sum(event_subscribe), 0)\n as event_subscribe \n \n from __dbt__cte__int_apple_store__sales_subscription_events\n group by 1,2\n), \n\njoined as (\n\n select \n subscription_events.*,\n active_free_trial_introductory_offer_subscriptions,\n active_pay_as_you_go_introductory_offer_subscriptions,\n active_pay_up_front_introductory_offer_subscriptions,\n active_standard_price_subscriptions\n from subscription_summary \n left join subscription_events\n on subscription_summary.date_day = subscription_events.date_day\n and subscription_summary.app_id = subscription_events.app_id \n)\n\nselect * \nfrom joined\n)"}, {"id": "model.apple_store.int_apple_store__usage_overview", "sql": " __dbt__cte__int_apple_store__usage_overview as (\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2\n)\n\nselect * \nfrom aggregated\n)"}], "relation_name": "`dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__overview_report`"}, "model.apple_store.int_apple_store__app_store_source_type": {"raw_sql": "with base as (\n\n select * \n from {{ var('app_store_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n {{ dbt_utils.group_by(3) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "source_type_report", "int_apple_store__app_store_source_type"], "unique_id": "model.apple_store.int_apple_store__app_store_source_type", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/source_type_report/int_apple_store__app_store_source_type.sql", "original_file_path": "models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql", "name": "int_apple_store__app_store_source_type", "alias": "int_apple_store__app_store_source_type", "checksum": {"name": "sha256", "checksum": "23b6897a7624959995aa9e9ce3557b7a17582543a9f061c5bc4bf6c51f556e8d"}, "tags": [], "refs": [["stg_apple_store__app_store_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/source_type_report/int_apple_store__app_store_source_type.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035146.9960608, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2,3\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__downloads_source_type": {"raw_sql": "with base as (\n \n select * \n from {{ var('downloads_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n {{ dbt_utils.group_by(3) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "source_type_report", "int_apple_store__downloads_source_type"], "unique_id": "model.apple_store.int_apple_store__downloads_source_type", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/source_type_report/int_apple_store__downloads_source_type.sql", "original_file_path": "models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql", "name": "int_apple_store__downloads_source_type", "alias": "int_apple_store__downloads_source_type", "checksum": {"name": "sha256", "checksum": "ae96bbd1095b8bb54c43db3f71c64ceacbac15d9eb1df5ef7d473f97e0518821"}, "tags": [], "refs": [["stg_apple_store__downloads_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/source_type_report/int_apple_store__downloads_source_type.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.0026119, "compiled_sql": "with base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2,3\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__usage_source_type": {"raw_sql": "with base as (\n\n select *\n from {{ var('usage_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n {{ dbt_utils.group_by(3) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "source_type_report", "int_apple_store__usage_source_type"], "unique_id": "model.apple_store.int_apple_store__usage_source_type", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/source_type_report/int_apple_store__usage_source_type.sql", "original_file_path": "models/intermediate/source_type_report/int_apple_store__usage_source_type.sql", "name": "int_apple_store__usage_source_type", "alias": "int_apple_store__usage_source_type", "checksum": {"name": "sha256", "checksum": "c2bee3a5e91b679f07ebd79c5be7f674617dcbd3e43727be9678498612dab831"}, "tags": [], "refs": [["stg_apple_store__usage_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/source_type_report/int_apple_store__usage_source_type.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.008089, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n source_type,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2,3\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__sales_subscription_overview": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith subscription_summary as (\n\n select\n date_day,\n app_id,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from {{ ref('int_apple_store__sales_subscription_summary') }}\n {{ dbt_utils.group_by(2) }}\n), \n\nsubscription_events as (\n\n select \n date_day,\n app_id\n {% for event_val in var('apple_store__subscription_events') %}\n {% set event_column = 'event_' ~ event_val | replace(' ', '_') | trim | lower %}\n , coalesce(sum({{event_column }}), 0)\n as {{ event_column }} \n {% endfor %}\n from {{ ref('int_apple_store__sales_subscription_events') }}\n {{ dbt_utils.group_by(2) }}\n), \n\njoined as (\n\n select \n subscription_events.*,\n active_free_trial_introductory_offer_subscriptions,\n active_pay_as_you_go_introductory_offer_subscriptions,\n active_pay_up_front_introductory_offer_subscriptions,\n active_standard_price_subscriptions\n from subscription_summary \n left join subscription_events\n on subscription_summary.date_day = subscription_events.date_day\n and subscription_summary.app_id = subscription_events.app_id \n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store.int_apple_store__sales_subscription_summary", "model.apple_store.int_apple_store__sales_subscription_events"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__sales_subscription_overview"], "unique_id": "model.apple_store.int_apple_store__sales_subscription_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__sales_subscription_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql", "name": "int_apple_store__sales_subscription_overview", "alias": "int_apple_store__sales_subscription_overview", "checksum": {"name": "sha256", "checksum": "641ba2b2c6deb6a78e36760690e6294ac7b6264da87b8976392c2e30022e6387"}, "tags": [], "refs": [["int_apple_store__sales_subscription_summary"], ["int_apple_store__sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__sales_subscription_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": true}, "created_at": 1654035147.012933, "compiled_sql": "\n\nwith __dbt__cte__int_apple_store__sales_subscription_summary as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined\n), __dbt__cte__int_apple_store__sales_subscription_events as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined\n),subscription_summary as (\n\n select\n date_day,\n app_id,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from __dbt__cte__int_apple_store__sales_subscription_summary\n group by 1,2\n), \n\nsubscription_events as (\n\n select \n date_day,\n app_id\n \n \n , coalesce(sum(event_renew), 0)\n as event_renew \n \n \n , coalesce(sum(event_cancel), 0)\n as event_cancel \n \n \n , coalesce(sum(event_subscribe), 0)\n as event_subscribe \n \n from __dbt__cte__int_apple_store__sales_subscription_events\n group by 1,2\n), \n\njoined as (\n\n select \n subscription_events.*,\n active_free_trial_introductory_offer_subscriptions,\n active_pay_as_you_go_introductory_offer_subscriptions,\n active_pay_up_front_introductory_offer_subscriptions,\n active_standard_price_subscriptions\n from subscription_summary \n left join subscription_events\n on subscription_summary.date_day = subscription_events.date_day\n and subscription_summary.app_id = subscription_events.app_id \n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.apple_store.int_apple_store__sales_subscription_summary", "sql": " __dbt__cte__int_apple_store__sales_subscription_summary as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined\n)"}, {"id": "model.apple_store.int_apple_store__sales_subscription_events", "sql": " __dbt__cte__int_apple_store__sales_subscription_events as (\n\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined\n)"}], "relation_name": null}, "model.apple_store.int_apple_store__usage_overview": {"raw_sql": "with base as (\n\n select *\n from {{ var('usage_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n {{ dbt_utils.group_by(2) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__usage_overview"], "unique_id": "model.apple_store.int_apple_store__usage_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__usage_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__usage_overview.sql", "name": "int_apple_store__usage_overview", "alias": "int_apple_store__usage_overview", "checksum": {"name": "sha256", "checksum": "930a9cd624be64f9c2918fc4c33e4b14e561c81a2875015e49dcfd1503d2e429"}, "tags": [], "refs": [["stg_apple_store__usage_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__usage_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.019509, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(active_devices) as active_devices,\n sum(deletions) as deletions,\n sum(installations) as installations,\n sum(sessions) as sessions\n from base\n group by 1,2\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__downloads_overview": {"raw_sql": "with base as (\n \n select * \n from {{ var('downloads_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n {{ dbt_utils.group_by(2) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__downloads_overview"], "unique_id": "model.apple_store.int_apple_store__downloads_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__downloads_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__downloads_overview.sql", "name": "int_apple_store__downloads_overview", "alias": "int_apple_store__downloads_overview", "checksum": {"name": "sha256", "checksum": "b61e8bb7971c4ab7f141df0228b2f549b9c815e6e2c87eff5cf996271def6988"}, "tags": [], "refs": [["stg_apple_store__downloads_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__downloads_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.024003, "compiled_sql": "with base as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(first_time_downloads) as first_time_downloads,\n sum(redownloads) as redownloads,\n sum(total_downloads) as total_downloads\n from base \n group by 1,2\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__crashes_overview": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_app_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(2) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__crashes_overview"], "unique_id": "model.apple_store.int_apple_store__crashes_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__crashes_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__crashes_overview.sql", "name": "int_apple_store__crashes_overview", "alias": "int_apple_store__crashes_overview", "checksum": {"name": "sha256", "checksum": "5546e27b29bd770eb9c61305b79e96c95a979f76e682528278239a56b4ede9fc"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__crashes_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.029383, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n sum(crashes) as crashes\n from base\n group by 1,2\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__app_store_overview": {"raw_sql": "with base as (\n\n select * \n from {{ var('app_store_device') }}\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n {{ dbt_utils.group_by(2) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "overview_report", "int_apple_store__app_store_overview"], "unique_id": "model.apple_store.int_apple_store__app_store_overview", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/overview_report/int_apple_store__app_store_overview.sql", "original_file_path": "models/intermediate/overview_report/int_apple_store__app_store_overview.sql", "name": "int_apple_store__app_store_overview", "alias": "int_apple_store__app_store_overview", "checksum": {"name": "sha256", "checksum": "a9fcada120a1c36f5a65e6df12945403f271e05ebedc5e54d6a51d6ab6ab6921"}, "tags": [], "refs": [["stg_apple_store__app_store_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/overview_report/int_apple_store__app_store_overview.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.0337589, "compiled_sql": "with base as (\n\n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n),\n\naggregated as (\n\n select \n date_day,\n app_id,\n sum(impressions) as impressions,\n sum(page_views) as page_views\n from base \n group by 1,2\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__platform_version": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_platform_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as {{ dbt_utils.type_string() }}) as source_type,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(4) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_platform_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "platform_version_report", "int_apple_store__platform_version"], "unique_id": "model.apple_store.int_apple_store__platform_version", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/platform_version_report/int_apple_store__platform_version.sql", "original_file_path": "models/intermediate/platform_version_report/int_apple_store__platform_version.sql", "name": "int_apple_store__platform_version", "alias": "int_apple_store__platform_version", "checksum": {"name": "sha256", "checksum": "968480190f4fc07f640010bc3c6ca7786682ede73fbb086f241c330473063394"}, "tags": [], "refs": [["stg_apple_store__crashes_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/platform_version_report/int_apple_store__platform_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.038213, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n platform_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__crashes_app_version": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_app_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as {{ dbt_utils.type_string() }}) as source_type,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(4) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "app_version_report", "int_apple_store__crashes_app_version"], "unique_id": "model.apple_store.int_apple_store__crashes_app_version", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/app_version_report/int_apple_store__crashes_app_version.sql", "original_file_path": "models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql", "name": "int_apple_store__crashes_app_version", "alias": "int_apple_store__crashes_app_version", "checksum": {"name": "sha256", "checksum": "a5ef8dbb297948eca44a4d0c58d4ddc2da7841689bec5dd2ab4a36077e558cf8"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/app_version_report/int_apple_store__crashes_app_version.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.0428832, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n app_version,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__sales_subscription_events": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select *\n from {{ var('sales_subscription_events') }}\n),\n\napp as (\n \n select *\n from {{ var('app') }}\n),\n\nsales_account as (\n \n select * \n from {{ var('sales_account') }}\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n {% for event_val in var('apple_store__subscription_events') %}\n {% if loop.index0 != 0 %}\n , \n {% endif %}\n '{{ var(\"apple_store__subscription_events\")[loop.index0] | trim | lower }}'\n {% endfor %} \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n {% for event_val in var('apple_store__subscription_events') %}\n , sum(case when lower(event) = '{{ event_val | trim | lower }}' then quantity else 0 end) as {{ 'event_' ~ event_val | replace(' ', '_') | trim | lower }}\n {% endfor %}\n from filtered\n {{ dbt_utils.group_by(6) }}\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n {% for event_val in var('apple_store__subscription_events') %}\n , pivoted.{{ 'event_' ~ event_val | replace(' ', '_') | trim | lower }}\n {% endfor %}\n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__sales_subscription_events", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__sales_account"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "subscription_report", "int_apple_store__sales_subscription_events"], "unique_id": "model.apple_store.int_apple_store__sales_subscription_events", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/subscription_report/int_apple_store__sales_subscription_events.sql", "original_file_path": "models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql", "name": "int_apple_store__sales_subscription_events", "alias": "int_apple_store__sales_subscription_events", "checksum": {"name": "sha256", "checksum": "7bc5e4ec7627359da3e30db609ed2b74c1a90cf13e00ccc342adc3180f8ae05f"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_events"], ["stg_apple_store__app"], ["stg_apple_store__sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/subscription_report/int_apple_store__sales_subscription_events.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": true}, "created_at": 1654035147.047604, "compiled_sql": "\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\nfiltered as (\n\n select *\n from base \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted as (\n \n select\n date_day\n , account_id\n , app_name\n , subscription_name\n , country\n , state\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered\n group by 1,2,3,4,5,6\n),\n\njoined as (\n\n select \n pivoted.date_day,\n pivoted.account_id,\n sales_account.account_name,\n app.app_id,\n pivoted.app_name,\n pivoted.subscription_name,\n pivoted.country,\n pivoted.state\n \n , pivoted.event_renew\n \n , pivoted.event_cancel\n \n , pivoted.event_subscribe\n \n from pivoted\n left join app \n on pivoted.app_name = app.app_name\n left join sales_account \n on pivoted.account_id = sales_account.account_id\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__sales_subscription_summary": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith base as (\n\n select *\n from {{ var('sales_subscription_summary') }}\n),\n\napp as (\n \n select *\n from {{ var('app') }}\n),\n\nsales_account as (\n \n select * \n from {{ var('sales_account') }}\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n {{ dbt_utils.group_by(8) }}\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__sales_subscription_summary", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__sales_account"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "subscription_report", "int_apple_store__sales_subscription_summary"], "unique_id": "model.apple_store.int_apple_store__sales_subscription_summary", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql", "original_file_path": "models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql", "name": "int_apple_store__sales_subscription_summary", "alias": "int_apple_store__sales_subscription_summary", "checksum": {"name": "sha256", "checksum": "b45e75214e49a8ba32c8bd476329abaf0c70c54b1d2e9a8ad0b7c3328e2fbd33"}, "tags": [], "refs": [["stg_apple_store__sales_subscription_summary"], ["stg_apple_store__app"], ["stg_apple_store__sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/subscription_report/int_apple_store__sales_subscription_summary.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": true}, "created_at": 1654035147.059542, "compiled_sql": "\n\nwith base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n),\n\napp as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsales_account as (\n \n select * \n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n),\n\njoined as (\n\n select \n base.date_day,\n base.account_id,\n sales_account.account_name,\n app.app_id,\n base.app_name,\n base.subscription_name,\n base.country,\n base.state,\n sum(base.active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(base.active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(base.active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(base.active_standard_price_subscriptions) as active_standard_price_subscriptions\n from base\n left join app \n on base.app_name = app.app_name\n left join sales_account \n on base.account_id = sales_account.account_id\n group by 1,2,3,4,5,6,7,8\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__subscription_device": {"raw_sql": "{{ config(enabled=var('apple_store__using_subscriptions', False)) }}\n\nwith app as (\n \n select *\n from {{ var('app') }}\n),\n\nsubscription_summary as (\n\n select\n date_day,\n app_name,\n device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from {{ var('sales_subscription_summary') }}\n {{ dbt_utils.group_by(3) }}\n), \n\nfiltered_subscription_events as (\n\n select *\n from {{ var('sales_subscription_events') }} \n where lower(event)\n in (\n {% for event_val in var('apple_store__subscription_events') %}\n {% if loop.index0 != 0 %}\n , \n {% endif %}\n '{{ var(\"apple_store__subscription_events\")[loop.index0] | trim | lower }}'\n {% endfor %} \n )\n),\n\npivoted_subscription_events as (\n \n select\n date_day\n , app_name\n , device\n {% for event_val in var('apple_store__subscription_events') %}\n , sum(case when lower(event) = '{{ event_val | trim | lower }}' then quantity else 0 end) as {{ 'event_' ~ event_val | replace(' ', '_') | trim | lower }}\n {% endfor %}\n from filtered_subscription_events\n {{ dbt_utils.group_by(3) }}\n),\n\njoined as (\n\n select \n app.app_id,\n pivoted_subscription_events.*,\n subscription_summary.active_free_trial_introductory_offer_subscriptions,\n subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions,\n subscription_summary.active_pay_up_front_introductory_offer_subscriptions,\n subscription_summary.active_standard_price_subscriptions,\n cast(null as {{ dbt_utils.type_string() }}) as source_type\n from subscription_summary \n left join pivoted_subscription_events\n on subscription_summary.date_day = pivoted_subscription_events.date_day\n and subscription_summary.app_name = pivoted_subscription_events.app_name\n and subscription_summary.device = pivoted_subscription_events.device\n left join app \n on subscription_summary.app_name = app.app_name\n)\n\nselect * \nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.type_string"], "nodes": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__sales_subscription_summary", "model.apple_store_source.stg_apple_store__sales_subscription_events"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "device_report", "int_apple_store__subscription_device"], "unique_id": "model.apple_store.int_apple_store__subscription_device", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/device_report/int_apple_store__subscription_device.sql", "original_file_path": "models/intermediate/device_report/int_apple_store__subscription_device.sql", "name": "int_apple_store__subscription_device", "alias": "int_apple_store__subscription_device", "checksum": {"name": "sha256", "checksum": "970149681698caf825fa215ddf85ae47fdb1ce1c8071f4bebf53b973adcf6e99"}, "tags": [], "refs": [["stg_apple_store__app"], ["stg_apple_store__sales_subscription_summary"], ["stg_apple_store__sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/device_report/int_apple_store__subscription_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store", "enabled": true}, "created_at": 1654035147.0665941, "compiled_sql": "\n\nwith app as (\n \n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n),\n\nsubscription_summary as (\n\n select\n date_day,\n app_name,\n device,\n sum(active_free_trial_introductory_offer_subscriptions) as active_free_trial_introductory_offer_subscriptions,\n sum(active_pay_as_you_go_introductory_offer_subscriptions) as active_pay_as_you_go_introductory_offer_subscriptions,\n sum(active_pay_up_front_introductory_offer_subscriptions) as active_pay_up_front_introductory_offer_subscriptions,\n sum(active_standard_price_subscriptions) as active_standard_price_subscriptions\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n group by 1,2,3\n), \n\nfiltered_subscription_events as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events` \n where lower(event)\n in (\n \n \n 'renew'\n \n \n , \n \n 'cancel'\n \n \n , \n \n 'subscribe'\n \n )\n),\n\npivoted_subscription_events as (\n \n select\n date_day\n , app_name\n , device\n \n , sum(case when lower(event) = 'renew' then quantity else 0 end) as event_renew\n \n , sum(case when lower(event) = 'cancel' then quantity else 0 end) as event_cancel\n \n , sum(case when lower(event) = 'subscribe' then quantity else 0 end) as event_subscribe\n \n from filtered_subscription_events\n group by 1,2,3\n),\n\njoined as (\n\n select \n app.app_id,\n pivoted_subscription_events.*,\n subscription_summary.active_free_trial_introductory_offer_subscriptions,\n subscription_summary.active_pay_as_you_go_introductory_offer_subscriptions,\n subscription_summary.active_pay_up_front_introductory_offer_subscriptions,\n subscription_summary.active_standard_price_subscriptions,\n cast(null as \n string\n) as source_type\n from subscription_summary \n left join pivoted_subscription_events\n on subscription_summary.date_day = pivoted_subscription_events.date_day\n and subscription_summary.app_name = pivoted_subscription_events.app_name\n and subscription_summary.device = pivoted_subscription_events.device\n left join app \n on subscription_summary.app_name = app.app_name\n)\n\nselect * \nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.apple_store.int_apple_store__crashes_device": {"raw_sql": "with base as (\n\n select *\n from {{ var('crashes_app_version') }}\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as {{ dbt_utils.type_string() }}) as source_type,\n sum(crashes) as crashes\n from base\n {{ dbt_utils.group_by(4) }}\n)\n\nselect * \nfrom aggregated", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.group_by"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": null, "schema": "apple_store", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_apple_store", "fqn": ["apple_store", "intermediate", "device_report", "int_apple_store__crashes_device"], "unique_id": "model.apple_store.int_apple_store__crashes_device", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "intermediate/device_report/int_apple_store__crashes_device.sql", "original_file_path": "models/intermediate/device_report/int_apple_store__crashes_device.sql", "name": "int_apple_store__crashes_device", "alias": "int_apple_store__crashes_device", "checksum": {"name": "sha256", "checksum": "f162c3702af244f4d2d94ad98604dd178d3986a6db7f0c9774e88afc54f7c3e6"}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/intermediate/device_report/int_apple_store__crashes_device.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "apple_store"}, "created_at": 1654035147.077365, "compiled_sql": "with base as (\n\n select *\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n),\n\naggregated as (\n\n select \n date_day, \n app_id,\n device,\n cast(null as \n string\n) as source_type,\n sum(crashes) as crashes\n from base\n group by 1,2,3,4\n)\n\nselect * \nfrom aggregated", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "app_id", "model": "{{ get_where_subquery(ref('stg_apple_store__app')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app"]}, "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": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "unique_stg_apple_store__app_app_id"], "unique_id": "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "unique_stg_apple_store__app_app_id.sql", "original_file_path": "models/stg_apple_store.yml", "name": "unique_stg_apple_store__app_app_id", "alias": "unique_stg_apple_store__app_app_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/unique_stg_apple_store__app_app_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1654035147.195065, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select app_id as unique_field\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app`\n where app_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "app_id", "file_key_name": "models.stg_apple_store__app"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('stg_apple_store__app_store_device')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_device"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app_store_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_df13595e157898353c3417fe4ee1c2c5"}, "created_at": 1654035147.196935, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_device`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__app_store_device"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__app_store_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app_store_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_65e343b57bc66318f7366ce6695aa8f9"}, "created_at": 1654035147.208301, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_platform_version`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__app_store_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory"], "model": "{{ get_where_subquery(ref('stg_apple_store__app_store_territory')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__app_store_territory"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory", "alias": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__app_store_territory"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c3ff4d076ca87d046d3e29346769faab"}, "created_at": 1654035147.212847, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__app_store_territory`\n group by date_day, app_id, source_type, territory\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__app_store_territory"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "device", "app_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__crashes_app_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_app_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version", "alias": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__crashes_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_65e8db18755c388c67191f7da93cd030"}, "created_at": 1654035147.2174861, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, device, app_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_app_version`\n group by date_day, app_id, device, app_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__crashes_app_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "device", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__crashes_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__crashes_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version", "alias": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__crashes_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e487a1ec94b024e453f7891d457f55dd"}, "created_at": 1654035147.2222168, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, device, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__crashes_platform_version`\n group by date_day, app_id, device, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__crashes_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('stg_apple_store__downloads_device')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_device"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__downloads_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e4f9780773c4a1dc133a79f07d0cc1fd"}, "created_at": 1654035147.226785, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_device`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__downloads_device"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__downloads_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__downloads_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fea3ab36ec538a4ce2f20378b442132e"}, "created_at": 1654035147.2313569, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_platform_version`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__downloads_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory"], "model": "{{ get_where_subquery(ref('stg_apple_store__downloads_territory')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__downloads_territory"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory", "alias": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__downloads_territory"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c0e894a9d24fda7e6e4f3eda943e187d"}, "created_at": 1654035147.235847, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__downloads_territory`\n group by date_day, app_id, source_type, territory\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__downloads_territory"}, "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_apple_store__sales_account')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__sales_account"]}, "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": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "unique_stg_apple_store__sales_account_account_id"], "unique_id": "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "unique_stg_apple_store__sales_account_account_id.sql", "original_file_path": "models/stg_apple_store.yml", "name": "unique_stg_apple_store__sales_account_account_id", "alias": "unique_stg_apple_store__sales_account_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__sales_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/unique_stg_apple_store__sales_account_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1654035147.2403321, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select account_id as unique_field\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_account`\n where account_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "account_id", "file_key_name": "models.stg_apple_store__sales_account"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id", "app_name", "subscription_name", "device", "event", "country", "state"], "model": "{{ get_where_subquery(ref('stg_apple_store__sales_subscription_events')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__sales_subscription_events"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state", "alias": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__sales_subscription_events"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e576637a23158f5dd6212e222ca7f43a"}, "created_at": 1654035147.241833, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, account_id, app_name, subscription_name, device, event, country, state\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_events`\n group by date_day, account_id, app_name, subscription_name, device, event, country, state\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__sales_subscription_events"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id", "app_name", "subscription_name", "device", "country", "state"], "model": "{{ get_where_subquery(ref('stg_apple_store__sales_subscription_summary')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__sales_subscription_summary"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state", "alias": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__sales_subscription_summary"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2e6d09068cc627da88917e004f573e37"}, "created_at": 1654035147.247446, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, account_id, app_name, subscription_name, device, country, state\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__sales_subscription_summary`\n group by date_day, account_id, app_name, subscription_name, device, country, state\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__sales_subscription_summary"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "app_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_app_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_app_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version", "alias": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_app_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_36bcedf09265f06fe173ff8ab9ca7735"}, "created_at": 1654035147.252907, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, app_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_app_version`\n group by date_day, app_id, source_type, app_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_app_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_device')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_device"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_device"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_b916ad3dd5e5b2177b55ff595bcac86d"}, "created_at": 1654035147.257796, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_device`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_device"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_platform_version')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_platform_version"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_platform_version"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_81d6606fd03dcb7816b6d87f738a6789"}, "created_at": 1654035147.262419, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_platform_version`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_platform_version"}, "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory"], "model": "{{ get_where_subquery(ref('stg_apple_store__usage_territory')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store_source.stg_apple_store__usage_territory"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store_source", "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory"], "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04.sql", "original_file_path": "models/stg_apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory", "alias": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_apple_store__usage_territory"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store_source/models/stg_apple_store.yml/dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_1632c0bc40973ecee92bac071e49dd04"}, "created_at": 1654035147.266922, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store_source`.`stg_apple_store__usage_territory`\n group by date_day, app_id, source_type, territory\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_apple_store__usage_territory"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "account_id", "app_id", "subscription_name", "territory_long", "state"], "model": "{{ get_where_subquery(ref('apple_store__subscription_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__subscription_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state", "alias": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__subscription_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_daf64cbf4c99065781067c9ef77f5490"}, "created_at": 1654035147.312149, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, account_id, app_id, subscription_name, territory_long, state\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__subscription_report`\n group by date_day, account_id, app_id, subscription_name, territory_long, state\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__subscription_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "territory_long"], "model": "{{ get_where_subquery(ref('apple_store__territory_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__territory_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long", "alias": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__territory_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3a83196092b46a0261fd93a17e7916cd"}, "created_at": 1654035147.317259, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, territory_long\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__territory_report`\n group by date_day, app_id, source_type, territory_long\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__territory_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "device"], "model": "{{ get_where_subquery(ref('apple_store__device_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__device_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device", "alias": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__device_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0ce81c68005b5b0e4a0eb48f5a1ecaa1"}, "created_at": 1654035147.3218, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, device\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__device_report`\n group by date_day, app_id, source_type, device\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__device_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type"], "model": "{{ get_where_subquery(ref('apple_store__source_type_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__source_type_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type", "alias": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__source_type_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_4da0984bd84186910d0f40f373771041"}, "created_at": 1654035147.32629, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__source_type_report`\n group by date_day, app_id, source_type\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__source_type_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id"], "model": "{{ get_where_subquery(ref('apple_store__overview_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__overview_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id", "alias": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__overview_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_6a54756e7f0196cfc0188572b9da23d7"}, "created_at": 1654035147.330376, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__overview_report`\n group by date_day, app_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__overview_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "platform_version"], "model": "{{ get_where_subquery(ref('apple_store__platform_version_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__platform_version_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version", "alias": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__platform_version_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_50e02f4a55aa4e31db05aad3853f3a08"}, "created_at": 1654035147.334412, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, platform_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__platform_version_report`\n group by date_day, app_id, source_type, platform_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__platform_version_report"}, "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["date_day", "app_id", "source_type", "app_version"], "model": "{{ get_where_subquery(ref('apple_store__app_version_report')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.apple_store.apple_store__app_version_report"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "dbt_apple_store_integration_tests_dbt_test__audit", "fqn": ["apple_store", "dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version"], "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea.sql", "original_file_path": "models/apple_store.yml", "name": "dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version", "alias": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["apple_store__app_version_report"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/apple_store/models/apple_store.yml/dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c52ff49ef186b7e11494dbe82fd45bea"}, "created_at": 1654035147.339199, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n date_day, app_id, source_type, app_version\n from `dbt-package-testing`.`dbt_apple_store_integration_tests_apple_store`.`apple_store__app_version_report`\n group by date_day, app_id, source_type, app_version\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.apple_store__app_version_report"}}, "sources": {"source.apple_store_source.apple_store.app": {"fqn": ["apple_store_source", "apple_store", "app"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.app", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing data about your application(s)", "columns": {"id": {"name": "id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicator for whether application is enabled or not.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`app`", "created_at": 1654035147.343269}, "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "app_store_platform_version_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.app_store_platform_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app_store_platform_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app_store_platform_version_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`app_store_platform_version_source_type`", "created_at": 1654035147.3434129}, "source.apple_store_source.apple_store.app_store_source_type_device_report": {"fqn": ["apple_store_source", "apple_store", "app_store_source_type_device_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.app_store_source_type_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app_store_source_type_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app_store_source_type_device", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by device and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`app_store_source_type_device`", "created_at": 1654035147.343541}, "source.apple_store_source.apple_store.app_store_territory_source_type_report": {"fqn": ["apple_store_source", "apple_store", "app_store_territory_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.app_store_territory_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "app_store_territory_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "app_store_territory_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily app store metrics (impressions, impressions_unique_device, page_views and page_views_unique_device) by territory and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "impressions_unique_device": {"name": "impressions_unique_device", "description": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views": {"name": "page_views", "description": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))", "meta": {}, "data_type": null, "quote": null, "tags": []}, "page_views_unique_device": {"name": "page_views_unique_device", "description": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`app_store_territory_source_type`", "created_at": 1654035147.3436632}, "source.apple_store_source.apple_store.crashes_app_version_device_report": {"fqn": ["apple_store_source", "apple_store", "crashes_app_version_device_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.crashes_app_version_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "crashes_app_version_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "crashes_app_version", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily crashes by app version and device.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`crashes_app_version`", "created_at": 1654035147.343776}, "source.apple_store_source.apple_store.crashes_platform_version_device_report": {"fqn": ["apple_store_source", "apple_store", "crashes_platform_version_device_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.crashes_platform_version_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "crashes_platform_version_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "crashes_platform_version", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily crashes by platform version and device.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "crashes": {"name": "crashes", "description": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`crashes_platform_version`", "created_at": 1654035147.343893}, "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "downloads_platform_version_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.downloads_platform_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "downloads_platform_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "downloads_platform_version_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`downloads_platform_version_source_type`", "created_at": 1654035147.3440099}, "source.apple_store_source.apple_store.downloads_source_type_device_report": {"fqn": ["apple_store_source", "apple_store", "downloads_source_type_device_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.downloads_source_type_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "downloads_source_type_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "downloads_source_type_device", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by device and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`downloads_source_type_device`", "created_at": 1654035147.344127}, "source.apple_store_source.apple_store.downloads_territory_source_type_report": {"fqn": ["apple_store_source", "apple_store", "downloads_territory_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.downloads_territory_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "downloads_territory_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "downloads_territory_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily downloads metrics (first time downloads, redownloads and total downloads) by territory and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_time_downloads": {"name": "first_time_downloads", "description": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "redownloads": {"name": "redownloads", "description": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_downloads": {"name": "total_downloads", "description": "Total Downloads is the sum of Redownloads and First Time Downloads.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`downloads_territory_source_type`", "created_at": 1654035147.344244}, "source.apple_store_source.apple_store.sales_account": {"fqn": ["apple_store_source", "apple_store", "sales_account"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.sales_account", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "sales_account", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "sales_account", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing sales account data.", "columns": {"id": {"name": "id", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Sales Account Name associated with the Sales Account ID, app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`sales_account`", "created_at": 1654035147.3443542}, "source.apple_store_source.apple_store.sales_subscription_event_summary": {"fqn": ["apple_store_source", "apple_store", "sales_subscription_event_summary"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.sales_subscription_event_summary", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "sales_subscription_event_summary", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "sales_subscription_events", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily subscription event report by account ID, app name, subscription name, event, country, state and device; this model is aggregated by date, app_name, account_id, country, state and subscription_name for easier transformations in the modeling package.", "columns": {"event_date": {"name": "event_date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "event": {"name": "event", "description": "The subscription event associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The number of occurrences of a given subscription event.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`sales_subscription_events`", "created_at": 1654035147.3444722}, "source.apple_store_source.apple_store.sales_subscription_summary": {"fqn": ["apple_store_source", "apple_store", "sales_subscription_summary"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.sales_subscription_summary", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "sales_subscription_summary", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "sales_subscription_summary", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily subscription summary report by account ID, app name, country, state and subscription name; this model is aggregated by date, app_name, account_id, country, state and subscription_name for easier transformations in the modeling package.", "columns": {"_filename": {"name": "_filename", "description": "Report filenames used to extract the date of the report", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "Application Name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Sales Account ID associated with the app name or app ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the subscription event metrics or subscription summary metrics.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "subscription_name": {"name": "subscription_name", "description": "The subscription name associated with the subscription event metric or subscription summary metric.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_free_trial_introductory_offer_subscriptions": {"name": "active_free_trial_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently in a free trial.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_pay_as_you_go_introductory_offer_subscriptions": {"name": "active_pay_as_you_go_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently with a pay as you go introductory price.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_pay_up_front_introductory_offer_subscriptions": {"name": "active_pay_up_front_introductory_offer_subscriptions", "description": "Total number of introductory offer subscriptions currently with a pay up front introductory price.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_standard_price_subscriptions": {"name": "active_standard_price_subscriptions", "description": "Total number of auto-renewable standard paid subscriptions currently active, excluding free trials, \nsubscription offers, introductory offers, and marketing opt-ins. Subscriptions are active during the period for which the customer has paid without cancellation.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`sales_subscription_summary`", "created_at": 1654035147.3445919}, "source.apple_store_source.apple_store.usage_app_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "usage_app_version_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.usage_app_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_app_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_app_version_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by app version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_version": {"name": "app_version", "description": "The app version of the app that the user is engaging with.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`usage_app_version_source_type`", "created_at": 1654035147.3447108}, "source.apple_store_source.apple_store.usage_platform_version_source_type_report": {"fqn": ["apple_store_source", "apple_store", "usage_platform_version_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.usage_platform_version_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_platform_version_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_platform_version_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by platform version and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "platform_version": {"name": "platform_version", "description": "The platform version of the device engaging with your app.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`usage_platform_version_source_type`", "created_at": 1654035147.344832}, "source.apple_store_source.apple_store.usage_source_type_device_report": {"fqn": ["apple_store_source", "apple_store", "usage_source_type_device_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.usage_source_type_device_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_source_type_device_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_source_type_device", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by device and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "device": {"name": "device", "description": "Device type associated with the respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`usage_source_type_device`", "created_at": 1654035147.3449512}, "source.apple_store_source.apple_store.usage_territory_source_type_report": {"fqn": ["apple_store_source", "apple_store", "usage_territory_source_type_report"], "database": "dbt-package-testing", "schema": "apple_store_integration_tests", "unique_id": "source.apple_store_source.apple_store.usage_territory_source_type_report", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "models/src_apple_store.yml", "original_file_path": "models/src_apple_store.yml", "name": "usage_territory_source_type_report", "source_name": "apple_store", "source_description": "", "loader": "Fivetran", "identifier": "usage_territory_source_type", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Daily usage metrics (active devices, active devices last 30 days, deletions, installations, sessions) by territory and source type.", "columns": {"date": {"name": "date", "description": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "Application ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_type": {"name": "source_type", "description": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "territory": {"name": "territory", "description": "The territory (aka country) full name associated with the report's respective metric(s).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices": {"name": "active_devices", "description": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "active_devices_last_30_days": {"name": "active_devices_last_30_days", "description": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deletions": {"name": "deletions", "description": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "installations": {"name": "installations", "description": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sessions": {"name": "sessions", "description": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`apple_store_integration_tests`.`usage_territory_source_type`", "created_at": 1654035147.3450701}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.494758}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.4952152}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.495817}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.501635}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5104241}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.511219}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.511977}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.512532}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, 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": 1654035145.513885}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.514396}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5150678}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__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": 1654035145.515541}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.515838}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5162601}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.51658}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5169}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/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": 1654035145.51707}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/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": 1654035145.517463}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.517877}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.518257}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.518854}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.519189}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.519517}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.52036}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.52116}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.52255}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.522905}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.523618}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.523958}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5252092}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.526336}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5275688}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.531125}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5335119}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.536811}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", 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": 1654035145.5377421}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.54048}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.542242}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5475352}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.548449}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.548783}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.549067}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.551253}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.551659}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.551965}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.552268}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.552572}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5534132}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.554048}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5546849}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.555625}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.556184}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5623722}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.562755}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.563232}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.563537}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.563746}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5652108}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5655591}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.56592}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\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": 1654035145.567942}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \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": 1654035145.571884}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.577015}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.577616}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5779681}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.578159}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.57857}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5801432}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.5804958}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.580972}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set 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": 1654035145.581771}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\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": 1654035145.591768}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.595504}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.596383}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.596962}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.597718}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.598437}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.599884}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6009102}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }} \n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.602035}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.606219}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set 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": 1654035145.608438}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6088698}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key 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": 1654035145.609727}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.610404}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- 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": 1654035145.611607}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.612891}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n \n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.621577}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.628633}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.63088}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6331031}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n \n {% do exceptions.raise_compiler_error(fail_msg) %}\n \n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n \n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {% endif %}\n \n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.634437}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.640896}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.641748}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6420941}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.642473}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n \n {{ sql_header if sql_header is not none }}\n \n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.643308}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6493282}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.649992}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.650403}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.652595}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.653345}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6536498}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.653989}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.654475}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set 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": 1654035145.659465}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.665348}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.667019}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6674528}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.668347}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.668621}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.668847}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.669151}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.669375}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.670262}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.670799}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6730502}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.673836}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.67427}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6752388}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6757371}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.676269}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.677112}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.677591}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6783192}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\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": 1654035145.678783}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.679359}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.680477}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% 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": 1654035145.682457}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.683522}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6840692}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6867971}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.689091}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.690481}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.690917}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.691686}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6920378}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6923468}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.692696}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6936262}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.693887}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.694185}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.694926}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.69746}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set 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": 1654035145.698027}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.698373}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.698782}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.699123}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6994328}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.6998148}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.700347}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.700806}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.701926}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% 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": 1654035145.702346}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.70271}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.703577}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.703854}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.704288}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7050729}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.706254}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.706572}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.706955}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7072709}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7077708}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.70866}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7109382}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.711429}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.71178}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.712118}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.712457}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7129128}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.713303}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.713963}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.714311}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.714612}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.717236}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.717537}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.718116}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7184682}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.719102}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.719527}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.720656}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.721132}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.722593}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.723635}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.724073}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.724607}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.725117}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.725705}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.725852}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7259939}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.726773}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7270982}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.727683}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7280269}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.729237}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.729384}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.729527}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7296681}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7298079}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.730113}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.730259}, "macro.dbt_utils.postgres__type_timestamp": {"unique_id": "macro.dbt_utils.postgres__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() %}\n timestamp without time zone\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.730401}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.730539}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.730837}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7309802}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.731116}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.731415}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.731561}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.731698}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.732001}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.732151}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.732291}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.732681}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.732827}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.732966}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7338932}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.734545}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.734751}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7349498}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7359722}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.736288}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.736602}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.736908}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7372758}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.737857}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.738006}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7381492}, "macro.dbt_utils.escape_single_quotes": {"unique_id": "macro.dbt_utils.escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.738857}, "macro.dbt_utils.default__escape_single_quotes": {"unique_id": "macro.dbt_utils.default__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.739125}, "macro.dbt_utils.snowflake__escape_single_quotes": {"unique_id": "macro.dbt_utils.snowflake__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.739383}, "macro.dbt_utils.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_utils.bigquery__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.739649}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.740638}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.740907}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7412071}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.741606}, "macro.dbt_utils.listagg": {"unique_id": "macro.dbt_utils.listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt_utils') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.745003}, "macro.dbt_utils.default__listagg": {"unique_id": "macro.dbt_utils.default__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7457652}, "macro.dbt_utils.bigquery__listagg": {"unique_id": "macro.dbt_utils.bigquery__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7462962}, "macro.dbt_utils.postgres__listagg": {"unique_id": "macro.dbt_utils.postgres__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n \n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7470348}, "macro.dbt_utils.redshift__listagg": {"unique_id": "macro.dbt_utils.redshift__listagg", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/listagg.sql", "original_file_path": "macros/cross_db_utils/listagg.sql", "name": "redshift__listagg", "macro_sql": "{% macro redshift__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n {% set ns = namespace() %}\n {% set ns.delimiter_text_regex = delimiter_text|trim(\"'\") %}\n {% set special_chars %}\\,^,$,.,|,?,*,+,(,),[,],{,}{% endset %} \n {%- for char in special_chars.split(',') -%}\n {% set escape_char %}\\\\{{ char }}{% endset %}\n {% set ns.delimiter_text_regex = ns.delimiter_text_regex|replace(char,escape_char) %}\n {%- endfor -%}\n\n {% set regex %}'([^{{ ns.delimiter_text_regex }}]+{{ ns.delimiter_text_regex }}){1,{{ limit_num - 1}}}[^{{ ns.delimiter_text_regex }}]+'{% endset %}\n regexp_substr(\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,{{ regex }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.749204}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.753068}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.753379}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.753682}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.756927}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) -%}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.757298}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7580469}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.75832}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7585652}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7588081}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.759448}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.759755}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.760001}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.760663}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7609348}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.761176}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.762156}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.762362}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.762561}, "macro.dbt_utils.any_value": {"unique_id": "macro.dbt_utils.any_value", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.763206}, "macro.dbt_utils.default__any_value": {"unique_id": "macro.dbt_utils.default__any_value", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n \n any_value({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.763412}, "macro.dbt_utils.postgres__any_value": {"unique_id": "macro.dbt_utils.postgres__any_value", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n {#- /*Postgres doesn't support any_value, so we're using min() to get the same result*/ -#}\n min({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7636201}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.764374}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7646441}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7649071}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.765578}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.765781}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.766788}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.767043}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7671869}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.767328}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.767633}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.76785}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.768129}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.768349}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.768599}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.770761}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.77163}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.772494}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.772854}, "macro.dbt_utils.bool_or": {"unique_id": "macro.dbt_utils.bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.773553}, "macro.dbt_utils.default__bool_or": {"unique_id": "macro.dbt_utils.default__bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n \n bool_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7737541}, "macro.dbt_utils.snowflake__bool_or": {"unique_id": "macro.dbt_utils.snowflake__bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n \n boolor_agg({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.773951}, "macro.dbt_utils.bigquery__bool_or": {"unique_id": "macro.dbt_utils.bigquery__bool_or", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n \n logical_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7741451}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.775163}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7757592}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.776036}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7768}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.77713}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7793531}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.77967}, "macro.dbt_utils._split_part_negative": {"unique_id": "macro.dbt_utils._split_part_negative", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.780092}, "macro.dbt_utils.postgres__split_part": {"unique_id": "macro.dbt_utils.postgres__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.780706}, "macro.dbt_utils.redshift__split_part": {"unique_id": "macro.dbt_utils.redshift__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "redshift__split_part", "macro_sql": "{% macro redshift__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt_utils.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt_utils._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__split_part", "macro.dbt_utils._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7813241}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }}) \n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7819982}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.782717}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7829702}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7832232}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.784789}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.7930582}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.794007}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.794587}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.795525}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}}\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8048499}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.805621}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8064919}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.807401}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1654035145.808606}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.809303}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1654035145.809957}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.810924}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.811337}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8121622}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.812714}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.813872}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.814503}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.815312}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.815938}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8166242}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8169549}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.818066}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.819169}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8201768}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8208902}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.821743}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_unique_where.sql", "original_file_path": "macros/generic_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8220959}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.822795}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8231292}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.824228}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.825422}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.826497}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1654035145.8271239}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.828046}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\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": 1654035145.8286002}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8294342}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8303869}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.8315468}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, previous_column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.832774}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8336372}, "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/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/test_not_null_where.sql", "original_file_path": "macros/generic_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8339531}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.835212}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.836837}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.841269}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 }}\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": 1654035145.844129}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8447459}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.84506}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.845694}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.84606}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.846658}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.846983}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.847959}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.84927}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1654035145.8503659}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.850796}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n 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": 1654035145.8514612}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.852142}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.852882}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.854096}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.855663}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.857043}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.857834}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.858189}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.859159}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.860403}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.861962}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.862846}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8633668}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.864506}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {% endif %}\n\n {%- for col in dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.866086}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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', 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": 1654035145.8687859}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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', 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": 1654035145.872559}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8762822}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.881572}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.882221}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8826828}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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=none, relation_alias=none) -%}\n\n {%- set error_message_group_by -%}\nWarning: the `group_by` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nUse `partition_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if kwargs.get('group_by') %}\n {%- do exceptions.warn(error_message_group_by) -%}\n {%- endif -%}\n\n {%- set error_message_order_by -%}\nWarning: `order_by` as an optional parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nSupply a non-null value for `order_by` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if not order_by %}\n {%- do exceptions.warn(error_message_order_by) -%}\n {%- endif -%}\n\n {%- set error_message_alias -%}\nWarning: the `relation_alias` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils.\nIf you were using `relation_alias` to point to a CTE previously then you can now pass the alias directly to `relation` instead.\nThe {{ model.package_name }}.{{ model.name }} model triggered this warning.\n {%- endset -%}\n\n {% if relation_alias %}\n {%- do exceptions.warn(error_message_alias) -%}\n {%- endif -%}\n\n {% set partition_by = partition_by or kwargs.get('group_by') %}\n {% set relation = relation_alias or relation %}\n {% set order_by = order_by or \"'1'\" %}\n\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8866298}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8870342}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8874109}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.8877702}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.888085}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.888408}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 {# 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": 1654035145.889481}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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{%- 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": 1654035145.8911831}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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() -%}\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": 1654035145.892203}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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() -%}\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": 1654035145.8927329}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.893503}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.894132}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.896466}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 \"table_schema\",\n table_name as \"table_name\",\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.8969831}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.89841}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.899355}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.901154}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.903921}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.905728}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9072928}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.908194}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.909581}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.91037}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.911463}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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.bigquery__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.912323}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.912489}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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 \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.912649}, "macro.dbt_utils.bigquery__get_table_types_sql": {"unique_id": "macro.dbt_utils.bigquery__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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": "bigquery__get_table_types_sql", "macro_sql": "{% macro bigquery__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as `table_type`\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.912805}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9144351}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.914955}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.91602}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9176168}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9251149}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.926471}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.928114}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.929472}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9308228}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.932485}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "name": "spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.932947}, "macro.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.933287}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.937962}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.949336}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9497159}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.949861}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9509609}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9536839}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.954296}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9548001}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.955302}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9559941}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.956377}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.956892}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.957737}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.959209}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9595242}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.960181}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.960659}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.961268}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9618912}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9633632}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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) %}\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": 1654035145.964789}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.9667919}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9674659}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.968429}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9691992}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.969745}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9703639}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.971044}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.971803}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9721012}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.97232}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.972571}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.97355}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.974934}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.976338}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9772952}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9775648}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.977834}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.978103}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.978385}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.983008}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.983346}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9836621}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.983969}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1654035145.987388}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.988826}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9891}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.989633}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.990179}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.990437}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.990753}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9910002}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.99195}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035145.993047}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.994014}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.9944131}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.994844}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035145.995511}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_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": 1654035145.9972281}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.004033}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.004704}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.005546}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.008233}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.0092869}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.010367}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.010672}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.010973}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.0113091}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.011607}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.011901}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.013142}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.0149791}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.016195}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.016513}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.0168262}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.017139}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.017448}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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_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": 1654035146.017784}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.018386}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.018681}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.018882}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.020164}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.022172}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.025461}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.028196}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.028817}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.0290198}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.0292192}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.03007}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/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}, "patch_path": null, "arguments": [], "created_at": 1654035146.030936}, "macro.apple_store_source.get_downloads_territory_columns": {"unique_id": "macro.apple_store_source.get_downloads_territory_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_downloads_territory_columns.sql", "original_file_path": "macros/get_downloads_territory_columns.sql", "name": "get_downloads_territory_columns", "macro_sql": "{% macro get_downloads_territory_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"first_time_downloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"redownloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"territory\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_downloads\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.032968}, "macro.apple_store_source.get_app_store_device_columns": {"unique_id": "macro.apple_store_source.get_app_store_device_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_store_device_columns.sql", "original_file_path": "macros/get_app_store_device_columns.sql", "name": "get_app_store_device_columns", "macro_sql": "{% macro get_app_store_device_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"impressions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"impressions_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"page_views\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"page_views_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.035176}, "macro.apple_store_source.get_app_store_territory_columns": {"unique_id": "macro.apple_store_source.get_app_store_territory_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_store_territory_columns.sql", "original_file_path": "macros/get_app_store_territory_columns.sql", "name": "get_app_store_territory_columns", "macro_sql": "{% macro get_app_store_territory_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"impressions_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"page_views\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"page_views_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"territory\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.037447}, "macro.apple_store_source.get_usage_platform_version_columns": {"unique_id": "macro.apple_store_source.get_usage_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_platform_version_columns.sql", "original_file_path": "macros/get_usage_platform_version_columns.sql", "name": "get_usage_platform_version_columns", "macro_sql": "{% macro get_usage_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"platform_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.039837}, "macro.apple_store_source.get_app_store_platform_version_columns": {"unique_id": "macro.apple_store_source.get_app_store_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_store_platform_version_columns.sql", "original_file_path": "macros/get_app_store_platform_version_columns.sql", "name": "get_app_store_platform_version_columns", "macro_sql": "{% macro get_app_store_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"impressions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"impressions_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"page_views\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"page_views_unique_device\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"platform_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.04229}, "macro.apple_store_source.get_downloads_platform_version_columns": {"unique_id": "macro.apple_store_source.get_downloads_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_downloads_platform_version_columns.sql", "original_file_path": "macros/get_downloads_platform_version_columns.sql", "name": "get_downloads_platform_version_columns", "macro_sql": "{% macro get_downloads_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"first_time_downloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"platform_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"redownloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_downloads\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.044325}, "macro.apple_store_source.get_sales_subscription_summary_columns": {"unique_id": "macro.apple_store_source.get_sales_subscription_summary_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_sales_subscription_summary_columns.sql", "original_file_path": "macros/get_sales_subscription_summary_columns.sql", "name": "get_sales_subscription_summary_columns", "macro_sql": "{% macro get_sales_subscription_summary_columns() %}\n\n{% set columns = [\n {\"name\": \"_filename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"_index\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_free_trial_introductory_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_pay_as_you_go_introductory_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_pay_up_front_introductory_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_standard_price_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billing_retry\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customer_price\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"developer_proceeds\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"free_trial_promotional_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"grace_period\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"marketing_opt_ins\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"pay_as_you_go_promotional_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"pay_up_front_promotional_offer_subscriptions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"proceeds_currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"proceeds_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"standard_subscription_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_group_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_number\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.050499}, "macro.apple_store_source.get_crashes_platform_version_columns": {"unique_id": "macro.apple_store_source.get_crashes_platform_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_crashes_platform_version_columns.sql", "original_file_path": "macros/get_crashes_platform_version_columns.sql", "name": "get_crashes_platform_version_columns", "macro_sql": "{% macro get_crashes_platform_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"crashes\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"platform_version\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.052195}, "macro.apple_store_source.get_sales_subscription_events_columns": {"unique_id": "macro.apple_store_source.get_sales_subscription_events_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_sales_subscription_events_columns.sql", "original_file_path": "macros/get_sales_subscription_events_columns.sql", "name": "get_sales_subscription_events_columns", "macro_sql": "{% macro get_sales_subscription_events_columns() %}\n\n{% set columns = [\n {\"name\": \"_filename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"_index\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"account_number\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"cancellation_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"consecutive_paid_periods\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"country\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"days_before_canceling\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"days_canceled\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"event\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"event_date\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"marketing_opt_in_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"original_start_date\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"previous_subscription_apple_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"previous_subscription_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"proceeds_reason\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_id\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"promotional_offer_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"quantity\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"standard_subscription_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_apple_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_group_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"subscription_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_offer_duration\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"subscription_offer_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendor_number\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.058229}, "macro.apple_store_source.get_downloads_device_columns": {"unique_id": "macro.apple_store_source.get_downloads_device_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_downloads_device_columns.sql", "original_file_path": "macros/get_downloads_device_columns.sql", "name": "get_downloads_device_columns", "macro_sql": "{% macro get_downloads_device_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"first_time_downloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"redownloads\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"total_downloads\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.060273}, "macro.apple_store_source.get_usage_device_columns": {"unique_id": "macro.apple_store_source.get_usage_device_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_device_columns.sql", "original_file_path": "macros/get_usage_device_columns.sql", "name": "get_usage_device_columns", "macro_sql": "{% macro get_usage_device_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.0626628}, "macro.apple_store_source.get_sales_account_columns": {"unique_id": "macro.apple_store_source.get_sales_account_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_sales_account_columns.sql", "original_file_path": "macros/get_sales_account_columns.sql", "name": "get_sales_account_columns", "macro_sql": "{% macro get_sales_account_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.063701}, "macro.apple_store_source.get_date_from_string": {"unique_id": "macro.apple_store_source.get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "get_date_from_string", "macro_sql": "{% macro get_date_from_string(string_text) %}\n {{ return(adapter.dispatch('get_date_from_string') (string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.apple_store_source.bigquery__get_date_from_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.064418}, "macro.apple_store_source.default__get_date_from_string": {"unique_id": "macro.apple_store_source.default__get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "default__get_date_from_string", "macro_sql": "{% macro default__get_date_from_string(string_text) %}\n\n to_date(\n {{ string_text }}, \n 'YYYYMMDD'\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.064628}, "macro.apple_store_source.bigquery__get_date_from_string": {"unique_id": "macro.apple_store_source.bigquery__get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "bigquery__get_date_from_string", "macro_sql": "{% macro bigquery__get_date_from_string(string_text) %}\n\n parse_date(\n '%Y%m%d',\n {{ string_text }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.064832}, "macro.apple_store_source.spark__get_date_from_string": {"unique_id": "macro.apple_store_source.spark__get_date_from_string", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_date_from_string.sql", "original_file_path": "macros/get_date_from_string.sql", "name": "spark__get_date_from_string", "macro_sql": "{% macro spark__get_date_from_string(string_text) %}\n\n to_date(\n {{ string_text }},\n 'yyyyMMdd'\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.065034}, "macro.apple_store_source.get_crashes_app_version_columns": {"unique_id": "macro.apple_store_source.get_crashes_app_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_crashes_app_version_columns.sql", "original_file_path": "macros/get_crashes_app_version_columns.sql", "name": "get_crashes_app_version_columns", "macro_sql": "{% macro get_crashes_app_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"crashes\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"device\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"}\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": 1654035146.0667362}, "macro.apple_store_source.get_usage_territory_columns": {"unique_id": "macro.apple_store_source.get_usage_territory_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_territory_columns.sql", "original_file_path": "macros/get_usage_territory_columns.sql", "name": "get_usage_territory_columns", "macro_sql": "{% macro get_usage_territory_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"territory\", \"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_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.0692449}, "macro.apple_store_source.get_usage_app_version_columns": {"unique_id": "macro.apple_store_source.get_usage_app_version_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_usage_app_version_columns.sql", "original_file_path": "macros/get_usage_app_version_columns.sql", "name": "get_usage_app_version_columns", "macro_sql": "{% macro get_usage_app_version_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"active_devices\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"active_devices_last_30_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"app_version\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"date\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"deletions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"installations\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"meets_threshold\", \"datatype\": \"boolean\"},\n {\"name\": \"sessions\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"source_type\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1654035146.071639}, "macro.apple_store_source.get_app_columns": {"unique_id": "macro.apple_store_source.get_app_columns", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "macros/get_app_columns.sql", "original_file_path": "macros/get_app_columns.sql", "name": "get_app_columns", "macro_sql": "{% macro get_app_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"app_opt_in_rate\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"asset_token\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"icon_url\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"ios\", \"datatype\": \"boolean\"},\n {\"name\": \"is_bundle\", \"datatype\": \"boolean\"},\n {\"name\": \"is_enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"pre_order_info\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"tvos\", \"datatype\": \"boolean\"}\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": 1654035146.0739598}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "apple_store_source._fivetran_synced": {"unique_id": "apple_store_source._fivetran_synced", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "_fivetran_synced", "block_contents": "Timestamp of when Fivetran synced a record."}, "apple_store_source.account_id": {"unique_id": "apple_store_source.account_id", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "account_id", "block_contents": "Sales Account ID associated with the app name or app ID."}, "apple_store_source.account_name": {"unique_id": "apple_store_source.account_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "account_name", "block_contents": "Sales Account Name associated with the Sales Account ID, app name or app ID."}, "apple_store_source.active_devices": {"unique_id": "apple_store_source.active_devices", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_devices", "block_contents": "The count of active_device is the count of devices that ran the app at least one time and for at least two seconds on a given day (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices or no value from the source report that day."}, "apple_store_source.active_devices_last_30_days": {"unique_id": "apple_store_source.active_devices_last_30_days", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_devices_last_30_days", "block_contents": "The count of active_devices_last_30_days is the count of devices that ran the app at least one time and for at least two seconds on the date_day of the report minus 30 days (User Opt-In only); this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI. A value of 0 indicates there were 0 active devices last 30 days or no value from the source report that day."}, "apple_store_source.active_free_trial_introductory_offer_subscriptions": {"unique_id": "apple_store_source.active_free_trial_introductory_offer_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_free_trial_introductory_offer_subscriptions", "block_contents": "Total number of introductory offer subscriptions currently in a free trial."}, "apple_store_source.active_pay_as_you_go_introductory_offer_subscriptions": {"unique_id": "apple_store_source.active_pay_as_you_go_introductory_offer_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_pay_as_you_go_introductory_offer_subscriptions", "block_contents": "Total number of introductory offer subscriptions currently with a pay as you go introductory price."}, "apple_store_source.active_pay_up_front_introductory_offer_subscriptions": {"unique_id": "apple_store_source.active_pay_up_front_introductory_offer_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_pay_up_front_introductory_offer_subscriptions", "block_contents": "Total number of introductory offer subscriptions currently with a pay up front introductory price."}, "apple_store_source.active_standard_price_subscriptions": {"unique_id": "apple_store_source.active_standard_price_subscriptions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "active_standard_price_subscriptions", "block_contents": "Total number of auto-renewable standard paid subscriptions currently active, excluding free trials, \nsubscription offers, introductory offers, and marketing opt-ins. Subscriptions are active during the period for which the customer has paid without cancellation."}, "apple_store_source.alternative_country_name": {"unique_id": "apple_store_source.alternative_country_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "alternative_country_name", "block_contents": "Due to differences in the official ISO country names and Apple's naming convention, we've added an alternative territory name that will allow us to join reports and infer ISO fields."}, "apple_store_source.app_id": {"unique_id": "apple_store_source.app_id", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "app_id", "block_contents": "Application ID."}, "apple_store_source.app_name": {"unique_id": "apple_store_source.app_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "app_name", "block_contents": "Application Name."}, "apple_store_source.app_version": {"unique_id": "apple_store_source.app_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "app_version", "block_contents": "The app version of the app that the user is engaging with."}, "apple_store_source.country": {"unique_id": "apple_store_source.country", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country", "block_contents": "The country associated with the subscription event metrics and subscription summary metric(s). This country code maps to ISO-3166 Alpha-2."}, "apple_store_source.country_code_alpha_2": {"unique_id": "apple_store_source.country_code_alpha_2", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_code_alpha_2", "block_contents": "The 2 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.country_code_alpha_3": {"unique_id": "apple_store_source.country_code_alpha_3", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_code_alpha_3", "block_contents": "The 3 character ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.country_code_numeric": {"unique_id": "apple_store_source.country_code_numeric", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_code_numeric", "block_contents": "The 3 digit ISO-3166 country code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.country_name": {"unique_id": "apple_store_source.country_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "country_name", "block_contents": "The ISO-3166 English country name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.crashes": {"unique_id": "apple_store_source.crashes", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "crashes", "block_contents": "The number of recorded crashes experienced (User Opt-In only); a value of 0 indicates there were 0 crash reports or no value from the source report that day."}, "apple_store_source.date_day": {"unique_id": "apple_store_source.date_day", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "date_day", "block_contents": "The date of the report and respective recorded metric(s); follows the format `YYYY-MM-DD`."}, "apple_store_source.deletions": {"unique_id": "apple_store_source.deletions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "deletions", "block_contents": "A deletion occurs when a user removes your app from their device (User Opt-In only). Data from resetting or erasing a device\u2019s content and settings is not included. A value of 0 indicates there were 0 deletions or no value from the source report that day."}, "apple_store_source.device": {"unique_id": "apple_store_source.device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "device", "block_contents": "Device type associated with the respective metric(s)."}, "apple_store_source.event": {"unique_id": "apple_store_source.event", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "event", "block_contents": "The subscription event associated with the respective metric(s)."}, "apple_store_source.first_time_downloads": {"unique_id": "apple_store_source.first_time_downloads", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "first_time_downloads", "block_contents": "The number of first time downloads for your app; credit is attributed to the referring app, website, or App Clip of the first time download."}, "apple_store_source.impressions": {"unique_id": "apple_store_source.impressions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "impressions", "block_contents": "The number of times your app was viewed in the App Store for more than one second. This includes search results, Featured, Explore, Top Charts and App Product Page views. (Source: [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))"}, "apple_store_source.impressions_unique_device": {"unique_id": "apple_store_source.impressions_unique_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "impressions_unique_device", "block_contents": "The number of unique devices that have viewed your app for more than one second on on the Today, Games, Apps, Featured, Explore, Top Charts, Search tabs of the App Store and App Product Page views. This metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI."}, "apple_store_source.installations": {"unique_id": "apple_store_source.installations", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "installations", "block_contents": "An installation event is when the user opens the App after they've downloaded it (User Opt-In only). If the App was downloaded but not opened or opened offline, this will not count; if the user opts out of sending data back to Apple, there will also be no data here. A value of 0 indicates there were 0 installations or no value from the source report that day."}, "apple_store_source.page_views": {"unique_id": "apple_store_source.page_views", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "page_views", "block_contents": "The total number of times your App Store product page was clicked and viewed; when a user taps on a link from an app, website or App Clip card that brings them to your App Store product page, the immediate product page_view is attributed to the referring app, website, or App Clip. (Sources: [Apple](https://help.apple.com/app-store-connect/#/itcf19c873df), [BusinessofApps](https://www.businessofapps.com/insights/understanding-the-app-store-metrics/#:~:text=Impressions%20%E2%80%93%20%E2%80%9CThe%20number%20of%20times,was%20clicked%20on%20and%20viewed.))"}, "apple_store_source.page_views_unique_device": {"unique_id": "apple_store_source.page_views_unique_device", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "page_views_unique_device", "block_contents": "The number of unique devices that have viewed your App Store product page; this metric is presumed to be de-duplicated daily as received from the source data, therefore, aggregating over a span of days is better done in the UI."}, "apple_store_source.platform_version": {"unique_id": "apple_store_source.platform_version", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "platform_version", "block_contents": "The platform version of the device engaging with your app."}, "apple_store_source.quantity": {"unique_id": "apple_store_source.quantity", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "quantity", "block_contents": "The number of occurrences of a given subscription event."}, "apple_store_source.sessions": {"unique_id": "apple_store_source.sessions", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "sessions", "block_contents": "Sessions is the count of the number of times the app has been used for at least two seconds (User Opt-In only). If the app is in the background and is later used again, that counts as another session. A value of 0 indicates there were 0 sessions or no value from the source report that day."}, "apple_store_source.redownloads": {"unique_id": "apple_store_source.redownloads", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "redownloads", "block_contents": "The count of redownloads where a redownload occurs when a user who previously downloaded your app adds it to their device again (User Opt-In only); credit is attributed to the source recorded when a user tapped to download/launch your app for the first time. A value of 0 indicates there were 0 redownloads or no value from the source report that day."}, "apple_store_source.region": {"unique_id": "apple_store_source.region", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "region", "block_contents": "The UN Statistics region name assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.region_code": {"unique_id": "apple_store_source.region_code", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "region_code", "block_contents": "The UN Statistics region numerical code assignment. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.source_type": {"unique_id": "apple_store_source.source_type", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "source_type", "block_contents": "A source is counted when a customer follows a link to your App Store product page. \nSource Types include:\n- Unavailable: Sales and usage data display sources as unavailable if users downloaded your app before App Analytics started tracking source attribution on April 15, 2017. As users download your app for the first time, you will see more complete sources data. If a user downloads your app using an App Store gift card or promotional code, the source type will also show as unavailable.\n- App Store Browse: Users viewed your app or tapped to download it while browsing the App Store (for example, in the Today, Games, or Apps sections).\n- App Store Search: Users viewed your app or downloaded it from Search on the App Store. Includes Search Ads in App Store search.\n- Institutional Purchase: Users downloaded your app from Apple Business Manager or Apple School Manager.\n- App Referrer: Users tapped a link in an app that brought them to your App Store product page. Includes apps using the StoreKit API to load your product page. Includes Apple apps, such as Messages, except Safari.\n- App Clip: Users tapped a link in your App Clip that brought them to your App Store product page. If the user then downloaded your app, the resulting Download is attributed to your App Clip as the source.\n- Web Referrer: Users tapped a link from a website that brought them to your App Store product page. If a chain of redirects in Safari leads to your App Store product page, the referring website will be the last URL in the chain.\n- Null: This is the default value for data that does not provide source types, including: crashes, subscription events and subscription summary."}, "apple_store_source.state": {"unique_id": "apple_store_source.state", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "state", "block_contents": "The state associated with the subscription event metrics or subscription summary metrics."}, "apple_store_source.sub_region": {"unique_id": "apple_store_source.sub_region", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "sub_region", "block_contents": "The UN Statistics sub-region name. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.sub_region_code": {"unique_id": "apple_store_source.sub_region_code", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "sub_region_code", "block_contents": "The UN Statistics sub-region numerical code. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store_source.subscription_name": {"unique_id": "apple_store_source.subscription_name", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "subscription_name", "block_contents": "The subscription name associated with the subscription event metric or subscription summary metric."}, "apple_store_source.territory": {"unique_id": "apple_store_source.territory", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "territory", "block_contents": "The territory (aka country) full name associated with the report's respective metric(s)."}, "apple_store_source.total_downloads": {"unique_id": "apple_store_source.total_downloads", "package_name": "apple_store_source", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store_source", "path": "docs.md", "original_file_path": "models/docs.md", "name": "total_downloads", "block_contents": "Total Downloads is the sum of Redownloads and First Time Downloads."}, "apple_store.territory_long": {"unique_id": "apple_store.territory_long", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "docs.md", "original_file_path": "models/docs.md", "name": "territory_long", "block_contents": "The territory (aka country) full name associated with the report's respective metric(s). Territory_long uses source territories for the following: downloads, usage and app store; territory_long is inferred from ISO-3166 using the 2-character country code for subscription events and subscription summary. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}, "apple_store.territory_short": {"unique_id": "apple_store.territory_short", "package_name": "apple_store", "root_path": "/Users/sheri.nguyen/dbt-packages/apple_store/dbt_apple_store/integration_tests/dbt_packages/apple_store", "path": "docs.md", "original_file_path": "models/docs.md", "name": "territory_short", "block_contents": "The 2-character country code associated with the report's respective metric(s). Territory_short uses source 2-character country codes for the subscription events and subscription summary; territory_short is inferred from ISO-3166 using source territories for the following: downloads, usage and app store. ([Original Source](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv))"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.apple_store_integration_tests.sales_account": [], "seed.apple_store_integration_tests.sales_subscription_summary": [], "seed.apple_store_integration_tests.downloads_source_type_device": [], "seed.apple_store_integration_tests.crashes_platform_version": [], "seed.apple_store_integration_tests.usage_app_version_source_type": [], "seed.apple_store_integration_tests.sales_subscription_events": [], "seed.apple_store_integration_tests.crashes_app_version": [], "seed.apple_store_integration_tests.downloads_territory_source_type": [], "seed.apple_store_integration_tests.usage_territory_source_type": [], "seed.apple_store_integration_tests.usage_source_type_device": [], "seed.apple_store_integration_tests.app_store_territory_source_type": [], "seed.apple_store_integration_tests.app_store_platform_version_source_type": [], "seed.apple_store_integration_tests.usage_platform_version_source_type": [], "seed.apple_store_integration_tests.downloads_platform_version_source_type": [], "seed.apple_store_integration_tests.app": [], "seed.apple_store_integration_tests.app_store_source_type_device": [], "model.apple_store_source.stg_apple_store__crashes_app_version": ["model.apple_store_source.stg_apple_store__crashes_app_version_tmp", "model.apple_store_source.stg_apple_store__crashes_app_version_tmp"], "model.apple_store_source.stg_apple_store__sales_account": ["model.apple_store_source.stg_apple_store__sales_account_tmp", "model.apple_store_source.stg_apple_store__sales_account_tmp"], "model.apple_store_source.stg_apple_store__usage_app_version": ["model.apple_store_source.stg_apple_store__usage_app_version_tmp", "model.apple_store_source.stg_apple_store__usage_app_version_tmp"], "model.apple_store_source.stg_apple_store__app_store_platform_version": ["model.apple_store_source.stg_apple_store__app_store_platform_version_tmp", "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"], "model.apple_store_source.stg_apple_store__app_store_territory": ["model.apple_store_source.stg_apple_store__app_store_territory_tmp", "model.apple_store_source.stg_apple_store__app_store_territory_tmp"], "model.apple_store_source.stg_apple_store__app_store_device": ["model.apple_store_source.stg_apple_store__app_store_device_tmp", "model.apple_store_source.stg_apple_store__app_store_device_tmp"], "model.apple_store_source.stg_apple_store__usage_device": ["model.apple_store_source.stg_apple_store__usage_device_tmp", "model.apple_store_source.stg_apple_store__usage_device_tmp"], "model.apple_store_source.stg_apple_store__downloads_device": ["model.apple_store_source.stg_apple_store__downloads_device_tmp", "model.apple_store_source.stg_apple_store__downloads_device_tmp"], "model.apple_store_source.stg_apple_store__sales_subscription_events": ["model.apple_store_source.stg_apple_store__sales_subscription_events_tmp", "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp"], "model.apple_store_source.stg_apple_store__usage_territory": ["model.apple_store_source.stg_apple_store__usage_territory_tmp", "model.apple_store_source.stg_apple_store__usage_territory_tmp"], "model.apple_store_source.stg_apple_store__sales_subscription_summary": ["model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp", "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp"], "model.apple_store_source.stg_apple_store__crashes_platform_version": ["model.apple_store_source.stg_apple_store__crashes_platform_version_tmp", "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"], "model.apple_store_source.stg_apple_store__app": ["model.apple_store_source.stg_apple_store__app_tmp", "model.apple_store_source.stg_apple_store__app_tmp"], "model.apple_store_source.stg_apple_store__downloads_platform_version": ["model.apple_store_source.stg_apple_store__downloads_platform_version_tmp", "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"], "model.apple_store_source.stg_apple_store__usage_platform_version": ["model.apple_store_source.stg_apple_store__usage_platform_version_tmp", "model.apple_store_source.stg_apple_store__usage_platform_version_tmp"], "model.apple_store_source.stg_apple_store__downloads_territory": ["model.apple_store_source.stg_apple_store__downloads_territory_tmp", "model.apple_store_source.stg_apple_store__downloads_territory_tmp"], "model.apple_store_source.stg_apple_store__app_tmp": ["source.apple_store_source.apple_store.app"], "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp": ["source.apple_store_source.apple_store.sales_subscription_event_summary"], "model.apple_store_source.stg_apple_store__usage_platform_version_tmp": ["source.apple_store_source.apple_store.usage_platform_version_source_type_report"], "model.apple_store_source.stg_apple_store__app_store_territory_tmp": ["source.apple_store_source.apple_store.app_store_territory_source_type_report"], "model.apple_store_source.stg_apple_store__downloads_territory_tmp": ["source.apple_store_source.apple_store.downloads_territory_source_type_report"], "model.apple_store_source.stg_apple_store__sales_account_tmp": ["source.apple_store_source.apple_store.sales_account"], "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp": ["source.apple_store_source.apple_store.downloads_platform_version_source_type_report"], "model.apple_store_source.stg_apple_store__usage_territory_tmp": ["source.apple_store_source.apple_store.usage_territory_source_type_report"], "model.apple_store_source.stg_apple_store__crashes_app_version_tmp": ["source.apple_store_source.apple_store.crashes_app_version_device_report"], "model.apple_store_source.stg_apple_store__downloads_device_tmp": ["source.apple_store_source.apple_store.downloads_source_type_device_report"], "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp": ["source.apple_store_source.apple_store.sales_subscription_summary"], "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp": ["source.apple_store_source.apple_store.crashes_platform_version_device_report"], "model.apple_store_source.stg_apple_store__app_store_device_tmp": ["source.apple_store_source.apple_store.app_store_source_type_device_report"], "model.apple_store_source.stg_apple_store__usage_app_version_tmp": ["source.apple_store_source.apple_store.usage_app_version_source_type_report"], "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp": ["source.apple_store_source.apple_store.app_store_platform_version_source_type_report"], "model.apple_store_source.stg_apple_store__usage_device_tmp": ["source.apple_store_source.apple_store.usage_source_type_device_report"], "seed.apple_store_source.apple_store_country_codes": [], "model.apple_store.apple_store__source_type_report": ["model.apple_store.int_apple_store__app_store_source_type", "model.apple_store.int_apple_store__downloads_source_type", "model.apple_store.int_apple_store__usage_source_type", "model.apple_store_source.stg_apple_store__app"], "model.apple_store.apple_store__subscription_report": ["model.apple_store.int_apple_store__sales_subscription_events", "model.apple_store.int_apple_store__sales_subscription_summary", "seed.apple_store_source.apple_store_country_codes"], "model.apple_store.apple_store__platform_version_report": ["model.apple_store.int_apple_store__platform_version", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_platform_version", "model.apple_store_source.stg_apple_store__downloads_platform_version", "model.apple_store_source.stg_apple_store__usage_platform_version"], "model.apple_store.apple_store__territory_report": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_territory", "model.apple_store_source.stg_apple_store__downloads_territory", "model.apple_store_source.stg_apple_store__usage_territory", "seed.apple_store_source.apple_store_country_codes"], "model.apple_store.apple_store__device_report": ["model.apple_store.int_apple_store__crashes_device", "model.apple_store.int_apple_store__subscription_device", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app_store_device", "model.apple_store_source.stg_apple_store__downloads_device", "model.apple_store_source.stg_apple_store__usage_device"], "model.apple_store.apple_store__app_version_report": ["model.apple_store.int_apple_store__crashes_app_version", "model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__usage_app_version"], "model.apple_store.apple_store__overview_report": ["model.apple_store.int_apple_store__app_store_overview", "model.apple_store.int_apple_store__crashes_overview", "model.apple_store.int_apple_store__downloads_overview", "model.apple_store.int_apple_store__sales_subscription_overview", "model.apple_store.int_apple_store__usage_overview", "model.apple_store_source.stg_apple_store__app"], "model.apple_store.int_apple_store__app_store_source_type": ["model.apple_store_source.stg_apple_store__app_store_device"], "model.apple_store.int_apple_store__downloads_source_type": ["model.apple_store_source.stg_apple_store__downloads_device"], "model.apple_store.int_apple_store__usage_source_type": ["model.apple_store_source.stg_apple_store__usage_device"], "model.apple_store.int_apple_store__sales_subscription_overview": ["model.apple_store.int_apple_store__sales_subscription_events", "model.apple_store.int_apple_store__sales_subscription_summary"], "model.apple_store.int_apple_store__usage_overview": ["model.apple_store_source.stg_apple_store__usage_device"], "model.apple_store.int_apple_store__downloads_overview": ["model.apple_store_source.stg_apple_store__downloads_device"], "model.apple_store.int_apple_store__crashes_overview": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "model.apple_store.int_apple_store__app_store_overview": ["model.apple_store_source.stg_apple_store__app_store_device"], "model.apple_store.int_apple_store__platform_version": ["model.apple_store_source.stg_apple_store__crashes_platform_version"], "model.apple_store.int_apple_store__crashes_app_version": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "model.apple_store.int_apple_store__sales_subscription_events": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__sales_account", "model.apple_store_source.stg_apple_store__sales_subscription_events"], "model.apple_store.int_apple_store__sales_subscription_summary": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__sales_account", "model.apple_store_source.stg_apple_store__sales_subscription_summary"], "model.apple_store.int_apple_store__subscription_device": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__sales_subscription_events", "model.apple_store_source.stg_apple_store__sales_subscription_summary"], "model.apple_store.int_apple_store__crashes_device": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa": ["model.apple_store_source.stg_apple_store__app"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067": ["model.apple_store_source.stg_apple_store__app_store_device"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a": ["model.apple_store_source.stg_apple_store__app_store_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f": ["model.apple_store_source.stg_apple_store__app_store_territory"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75": ["model.apple_store_source.stg_apple_store__crashes_app_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3": ["model.apple_store_source.stg_apple_store__crashes_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2": ["model.apple_store_source.stg_apple_store__downloads_device"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc": ["model.apple_store_source.stg_apple_store__downloads_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6": ["model.apple_store_source.stg_apple_store__downloads_territory"], "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8": ["model.apple_store_source.stg_apple_store__sales_account"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67": ["model.apple_store_source.stg_apple_store__sales_subscription_events"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4": ["model.apple_store_source.stg_apple_store__sales_subscription_summary"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2": ["model.apple_store_source.stg_apple_store__usage_app_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145": ["model.apple_store_source.stg_apple_store__usage_device"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6": ["model.apple_store_source.stg_apple_store__usage_platform_version"], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939": ["model.apple_store_source.stg_apple_store__usage_territory"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9": ["model.apple_store.apple_store__subscription_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6": ["model.apple_store.apple_store__territory_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996": ["model.apple_store.apple_store__device_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092": ["model.apple_store.apple_store__source_type_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968": ["model.apple_store.apple_store__overview_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68": ["model.apple_store.apple_store__platform_version_report"], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca": ["model.apple_store.apple_store__app_version_report"], "source.apple_store_source.apple_store.app": [], "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": [], "source.apple_store_source.apple_store.app_store_source_type_device_report": [], "source.apple_store_source.apple_store.app_store_territory_source_type_report": [], "source.apple_store_source.apple_store.crashes_app_version_device_report": [], "source.apple_store_source.apple_store.crashes_platform_version_device_report": [], "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": [], "source.apple_store_source.apple_store.downloads_source_type_device_report": [], "source.apple_store_source.apple_store.downloads_territory_source_type_report": [], "source.apple_store_source.apple_store.sales_account": [], "source.apple_store_source.apple_store.sales_subscription_event_summary": [], "source.apple_store_source.apple_store.sales_subscription_summary": [], "source.apple_store_source.apple_store.usage_app_version_source_type_report": [], "source.apple_store_source.apple_store.usage_platform_version_source_type_report": [], "source.apple_store_source.apple_store.usage_source_type_device_report": [], "source.apple_store_source.apple_store.usage_territory_source_type_report": []}, "child_map": {"seed.apple_store_integration_tests.sales_account": [], "seed.apple_store_integration_tests.sales_subscription_summary": [], "seed.apple_store_integration_tests.downloads_source_type_device": [], "seed.apple_store_integration_tests.crashes_platform_version": [], "seed.apple_store_integration_tests.usage_app_version_source_type": [], "seed.apple_store_integration_tests.sales_subscription_events": [], "seed.apple_store_integration_tests.crashes_app_version": [], "seed.apple_store_integration_tests.downloads_territory_source_type": [], "seed.apple_store_integration_tests.usage_territory_source_type": [], "seed.apple_store_integration_tests.usage_source_type_device": [], "seed.apple_store_integration_tests.app_store_territory_source_type": [], "seed.apple_store_integration_tests.app_store_platform_version_source_type": [], "seed.apple_store_integration_tests.usage_platform_version_source_type": [], "seed.apple_store_integration_tests.downloads_platform_version_source_type": [], "seed.apple_store_integration_tests.app": [], "seed.apple_store_integration_tests.app_store_source_type_device": [], "model.apple_store_source.stg_apple_store__crashes_app_version": ["model.apple_store.int_apple_store__crashes_app_version", "model.apple_store.int_apple_store__crashes_device", "model.apple_store.int_apple_store__crashes_overview", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75"], "model.apple_store_source.stg_apple_store__sales_account": ["model.apple_store.int_apple_store__sales_subscription_events", "model.apple_store.int_apple_store__sales_subscription_summary", "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8"], "model.apple_store_source.stg_apple_store__usage_app_version": ["model.apple_store.apple_store__app_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2"], "model.apple_store_source.stg_apple_store__app_store_platform_version": ["model.apple_store.apple_store__platform_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a"], "model.apple_store_source.stg_apple_store__app_store_territory": ["model.apple_store.apple_store__territory_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f"], "model.apple_store_source.stg_apple_store__app_store_device": ["model.apple_store.apple_store__device_report", "model.apple_store.int_apple_store__app_store_overview", "model.apple_store.int_apple_store__app_store_source_type", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067"], "model.apple_store_source.stg_apple_store__usage_device": ["model.apple_store.apple_store__device_report", "model.apple_store.int_apple_store__usage_overview", "model.apple_store.int_apple_store__usage_source_type", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145"], "model.apple_store_source.stg_apple_store__downloads_device": ["model.apple_store.apple_store__device_report", "model.apple_store.int_apple_store__downloads_overview", "model.apple_store.int_apple_store__downloads_source_type", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2"], "model.apple_store_source.stg_apple_store__sales_subscription_events": ["model.apple_store.int_apple_store__sales_subscription_events", "model.apple_store.int_apple_store__subscription_device", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67"], "model.apple_store_source.stg_apple_store__usage_territory": ["model.apple_store.apple_store__territory_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939"], "model.apple_store_source.stg_apple_store__sales_subscription_summary": ["model.apple_store.int_apple_store__sales_subscription_summary", "model.apple_store.int_apple_store__subscription_device", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4"], "model.apple_store_source.stg_apple_store__crashes_platform_version": ["model.apple_store.int_apple_store__platform_version", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3"], "model.apple_store_source.stg_apple_store__app": ["model.apple_store.apple_store__app_version_report", "model.apple_store.apple_store__device_report", "model.apple_store.apple_store__overview_report", "model.apple_store.apple_store__platform_version_report", "model.apple_store.apple_store__source_type_report", "model.apple_store.apple_store__territory_report", "model.apple_store.int_apple_store__sales_subscription_events", "model.apple_store.int_apple_store__sales_subscription_summary", "model.apple_store.int_apple_store__subscription_device", "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa"], "model.apple_store_source.stg_apple_store__downloads_platform_version": ["model.apple_store.apple_store__platform_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc"], "model.apple_store_source.stg_apple_store__usage_platform_version": ["model.apple_store.apple_store__platform_version_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6"], "model.apple_store_source.stg_apple_store__downloads_territory": ["model.apple_store.apple_store__territory_report", "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6"], "model.apple_store_source.stg_apple_store__app_tmp": ["model.apple_store_source.stg_apple_store__app", "model.apple_store_source.stg_apple_store__app"], "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp": ["model.apple_store_source.stg_apple_store__sales_subscription_events", "model.apple_store_source.stg_apple_store__sales_subscription_events"], "model.apple_store_source.stg_apple_store__usage_platform_version_tmp": ["model.apple_store_source.stg_apple_store__usage_platform_version", "model.apple_store_source.stg_apple_store__usage_platform_version"], "model.apple_store_source.stg_apple_store__app_store_territory_tmp": ["model.apple_store_source.stg_apple_store__app_store_territory", "model.apple_store_source.stg_apple_store__app_store_territory"], "model.apple_store_source.stg_apple_store__downloads_territory_tmp": ["model.apple_store_source.stg_apple_store__downloads_territory", "model.apple_store_source.stg_apple_store__downloads_territory"], "model.apple_store_source.stg_apple_store__sales_account_tmp": ["model.apple_store_source.stg_apple_store__sales_account", "model.apple_store_source.stg_apple_store__sales_account"], "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp": ["model.apple_store_source.stg_apple_store__downloads_platform_version", "model.apple_store_source.stg_apple_store__downloads_platform_version"], "model.apple_store_source.stg_apple_store__usage_territory_tmp": ["model.apple_store_source.stg_apple_store__usage_territory", "model.apple_store_source.stg_apple_store__usage_territory"], "model.apple_store_source.stg_apple_store__crashes_app_version_tmp": ["model.apple_store_source.stg_apple_store__crashes_app_version", "model.apple_store_source.stg_apple_store__crashes_app_version"], "model.apple_store_source.stg_apple_store__downloads_device_tmp": ["model.apple_store_source.stg_apple_store__downloads_device", "model.apple_store_source.stg_apple_store__downloads_device"], "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp": ["model.apple_store_source.stg_apple_store__sales_subscription_summary", "model.apple_store_source.stg_apple_store__sales_subscription_summary"], "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp": ["model.apple_store_source.stg_apple_store__crashes_platform_version", "model.apple_store_source.stg_apple_store__crashes_platform_version"], "model.apple_store_source.stg_apple_store__app_store_device_tmp": ["model.apple_store_source.stg_apple_store__app_store_device", "model.apple_store_source.stg_apple_store__app_store_device"], "model.apple_store_source.stg_apple_store__usage_app_version_tmp": ["model.apple_store_source.stg_apple_store__usage_app_version", "model.apple_store_source.stg_apple_store__usage_app_version"], "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp": ["model.apple_store_source.stg_apple_store__app_store_platform_version", "model.apple_store_source.stg_apple_store__app_store_platform_version"], "model.apple_store_source.stg_apple_store__usage_device_tmp": ["model.apple_store_source.stg_apple_store__usage_device", "model.apple_store_source.stg_apple_store__usage_device"], "seed.apple_store_source.apple_store_country_codes": ["model.apple_store.apple_store__subscription_report", "model.apple_store.apple_store__territory_report"], "model.apple_store.apple_store__source_type_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092"], "model.apple_store.apple_store__subscription_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9"], "model.apple_store.apple_store__platform_version_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68"], "model.apple_store.apple_store__territory_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6"], "model.apple_store.apple_store__device_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996"], "model.apple_store.apple_store__app_version_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca"], "model.apple_store.apple_store__overview_report": ["test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968"], "model.apple_store.int_apple_store__app_store_source_type": ["model.apple_store.apple_store__source_type_report"], "model.apple_store.int_apple_store__downloads_source_type": ["model.apple_store.apple_store__source_type_report"], "model.apple_store.int_apple_store__usage_source_type": ["model.apple_store.apple_store__source_type_report"], "model.apple_store.int_apple_store__sales_subscription_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__usage_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__downloads_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__crashes_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__app_store_overview": ["model.apple_store.apple_store__overview_report"], "model.apple_store.int_apple_store__platform_version": ["model.apple_store.apple_store__platform_version_report"], "model.apple_store.int_apple_store__crashes_app_version": ["model.apple_store.apple_store__app_version_report"], "model.apple_store.int_apple_store__sales_subscription_events": ["model.apple_store.apple_store__subscription_report", "model.apple_store.int_apple_store__sales_subscription_overview"], "model.apple_store.int_apple_store__sales_subscription_summary": ["model.apple_store.apple_store__subscription_report", "model.apple_store.int_apple_store__sales_subscription_overview"], "model.apple_store.int_apple_store__subscription_device": ["model.apple_store.apple_store__device_report"], "model.apple_store.int_apple_store__crashes_device": ["model.apple_store.apple_store__device_report"], "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6": [], "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6": [], "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68": [], "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca": [], "source.apple_store_source.apple_store.app": ["model.apple_store_source.stg_apple_store__app_tmp"], "source.apple_store_source.apple_store.app_store_platform_version_source_type_report": ["model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"], "source.apple_store_source.apple_store.app_store_source_type_device_report": ["model.apple_store_source.stg_apple_store__app_store_device_tmp"], "source.apple_store_source.apple_store.app_store_territory_source_type_report": ["model.apple_store_source.stg_apple_store__app_store_territory_tmp"], "source.apple_store_source.apple_store.crashes_app_version_device_report": ["model.apple_store_source.stg_apple_store__crashes_app_version_tmp"], "source.apple_store_source.apple_store.crashes_platform_version_device_report": ["model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"], "source.apple_store_source.apple_store.downloads_platform_version_source_type_report": ["model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"], "source.apple_store_source.apple_store.downloads_source_type_device_report": ["model.apple_store_source.stg_apple_store__downloads_device_tmp"], "source.apple_store_source.apple_store.downloads_territory_source_type_report": ["model.apple_store_source.stg_apple_store__downloads_territory_tmp"], "source.apple_store_source.apple_store.sales_account": ["model.apple_store_source.stg_apple_store__sales_account_tmp"], "source.apple_store_source.apple_store.sales_subscription_event_summary": ["model.apple_store_source.stg_apple_store__sales_subscription_events_tmp"], "source.apple_store_source.apple_store.sales_subscription_summary": ["model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp"], "source.apple_store_source.apple_store.usage_app_version_source_type_report": ["model.apple_store_source.stg_apple_store__usage_app_version_tmp"], "source.apple_store_source.apple_store.usage_platform_version_source_type_report": ["model.apple_store_source.stg_apple_store__usage_platform_version_tmp"], "source.apple_store_source.apple_store.usage_source_type_device_report": ["model.apple_store_source.stg_apple_store__usage_device_tmp"], "source.apple_store_source.apple_store.usage_territory_source_type_report": ["model.apple_store_source.stg_apple_store__usage_territory_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 07ceef6..a53ae19 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-05-19T18:11:39.944218Z", "invocation_id": "6fb5cc63-8a97-47af-b1a5-83f20142fb33", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.737916Z", "completed_at": "2022-05-19T18:11:34.743456Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.743915Z", "completed_at": "2022-05-19T18:11:34.743941Z"}], "thread_id": "Thread-1", "execution_time": 0.007090091705322266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.745708Z", "completed_at": "2022-05-19T18:11:34.750792Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.751189Z", "completed_at": "2022-05-19T18:11:34.751198Z"}], "thread_id": "Thread-1", "execution_time": 0.006438016891479492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app_store_platform_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.752810Z", "completed_at": "2022-05-19T18:11:34.754980Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.755373Z", "completed_at": "2022-05-19T18:11:34.755382Z"}], "thread_id": "Thread-1", "execution_time": 0.0035011768341064453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app_store_source_type_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.756951Z", "completed_at": "2022-05-19T18:11:34.759173Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.759697Z", "completed_at": "2022-05-19T18:11:34.759706Z"}], "thread_id": "Thread-1", "execution_time": 0.003834962844848633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app_store_territory_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.761343Z", "completed_at": "2022-05-19T18:11:34.763442Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.763811Z", "completed_at": "2022-05-19T18:11:34.763820Z"}], "thread_id": "Thread-1", "execution_time": 0.0035812854766845703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.crashes_app_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.765300Z", "completed_at": "2022-05-19T18:11:34.767208Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.767538Z", "completed_at": "2022-05-19T18:11:34.767546Z"}], "thread_id": "Thread-1", "execution_time": 0.0031464099884033203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.crashes_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.768871Z", "completed_at": "2022-05-19T18:11:34.770674Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.771001Z", "completed_at": "2022-05-19T18:11:34.771008Z"}], "thread_id": "Thread-1", "execution_time": 0.002991199493408203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.downloads_platform_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.772331Z", "completed_at": "2022-05-19T18:11:34.775103Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.775433Z", "completed_at": "2022-05-19T18:11:34.775440Z"}], "thread_id": "Thread-1", "execution_time": 0.0040209293365478516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.downloads_source_type_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.776763Z", "completed_at": "2022-05-19T18:11:34.778546Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.778879Z", "completed_at": "2022-05-19T18:11:34.778887Z"}], "thread_id": "Thread-1", "execution_time": 0.002975940704345703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.downloads_territory_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.780148Z", "completed_at": "2022-05-19T18:11:34.781908Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.782238Z", "completed_at": "2022-05-19T18:11:34.782246Z"}], "thread_id": "Thread-1", "execution_time": 0.0028438568115234375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.sales_account"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.783612Z", "completed_at": "2022-05-19T18:11:34.785369Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.785702Z", "completed_at": "2022-05-19T18:11:34.785710Z"}], "thread_id": "Thread-1", "execution_time": 0.0029959678649902344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.sales_subscription_events"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.786997Z", "completed_at": "2022-05-19T18:11:34.788794Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.789124Z", "completed_at": "2022-05-19T18:11:34.789131Z"}], "thread_id": "Thread-1", "execution_time": 0.0030062198638916016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.sales_subscription_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.790360Z", "completed_at": "2022-05-19T18:11:34.792051Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.792351Z", "completed_at": "2022-05-19T18:11:34.792358Z"}], "thread_id": "Thread-1", "execution_time": 0.002727985382080078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_app_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.793543Z", "completed_at": "2022-05-19T18:11:34.795918Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.796248Z", "completed_at": "2022-05-19T18:11:34.796255Z"}], "thread_id": "Thread-1", "execution_time": 0.0034360885620117188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_platform_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.797333Z", "completed_at": "2022-05-19T18:11:34.834897Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.835362Z", "completed_at": "2022-05-19T18:11:34.835374Z"}], "thread_id": "Thread-1", "execution_time": 0.03891301155090332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_source_type_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.837231Z", "completed_at": "2022-05-19T18:11:34.839401Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.839809Z", "completed_at": "2022-05-19T18:11:34.839818Z"}], "thread_id": "Thread-1", "execution_time": 0.0035398006439208984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_territory_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.841440Z", "completed_at": "2022-05-19T18:11:34.843900Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.844318Z", "completed_at": "2022-05-19T18:11:34.844328Z"}], "thread_id": "Thread-1", "execution_time": 0.0039048194885253906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_source.apple_store_country_codes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.845856Z", "completed_at": "2022-05-19T18:11:34.850771Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.851235Z", "completed_at": "2022-05-19T18:11:34.851245Z"}], "thread_id": "Thread-1", "execution_time": 0.006320953369140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.852812Z", "completed_at": "2022-05-19T18:11:34.856904Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.857316Z", "completed_at": "2022-05-19T18:11:34.857325Z"}], "thread_id": "Thread-1", "execution_time": 0.005416154861450195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.858966Z", "completed_at": "2022-05-19T18:11:34.862888Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.863297Z", "completed_at": "2022-05-19T18:11:34.863306Z"}], "thread_id": "Thread-1", "execution_time": 0.005378007888793945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_device_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.864880Z", "completed_at": "2022-05-19T18:11:34.869633Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.869988Z", "completed_at": "2022-05-19T18:11:34.869995Z"}], "thread_id": "Thread-1", "execution_time": 0.006129264831542969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.871268Z", "completed_at": "2022-05-19T18:11:34.874569Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.874918Z", "completed_at": "2022-05-19T18:11:34.874926Z"}], "thread_id": "Thread-1", "execution_time": 0.004414081573486328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.876254Z", "completed_at": "2022-05-19T18:11:34.879559Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.879916Z", "completed_at": "2022-05-19T18:11:34.879924Z"}], "thread_id": "Thread-1", "execution_time": 0.004476070404052734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.881257Z", "completed_at": "2022-05-19T18:11:34.884565Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.884926Z", "completed_at": "2022-05-19T18:11:34.884934Z"}], "thread_id": "Thread-1", "execution_time": 0.004525899887084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.886203Z", "completed_at": "2022-05-19T18:11:34.889494Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.889841Z", "completed_at": "2022-05-19T18:11:34.889849Z"}], "thread_id": "Thread-1", "execution_time": 0.00439906120300293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_device_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.891175Z", "completed_at": "2022-05-19T18:11:34.894467Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.894798Z", "completed_at": "2022-05-19T18:11:34.894805Z"}], "thread_id": "Thread-1", "execution_time": 0.004498958587646484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.896364Z", "completed_at": "2022-05-19T18:11:34.900206Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.900688Z", "completed_at": "2022-05-19T18:11:34.900694Z"}], "thread_id": "Thread-1", "execution_time": 0.005023002624511719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_account_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.901779Z", "completed_at": "2022-05-19T18:11:34.904359Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.904640Z", "completed_at": "2022-05-19T18:11:34.904646Z"}], "thread_id": "Thread-1", "execution_time": 0.0035429000854492188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.905913Z", "completed_at": "2022-05-19T18:11:34.908475Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.908741Z", "completed_at": "2022-05-19T18:11:34.908747Z"}], "thread_id": "Thread-1", "execution_time": 0.0034580230712890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.909782Z", "completed_at": "2022-05-19T18:11:34.912342Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.912614Z", "completed_at": "2022-05-19T18:11:34.912620Z"}], "thread_id": "Thread-1", "execution_time": 0.003428220748901367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_device_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.913606Z", "completed_at": "2022-05-19T18:11:34.916789Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:34.917066Z", "completed_at": "2022-05-19T18:11:34.917072Z"}], "thread_id": "Thread-1", "execution_time": 0.00406193733215332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_territory_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:34.918078Z", "completed_at": "2022-05-19T18:11:35.260023Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:35.260451Z", "completed_at": "2022-05-19T18:11:35.260462Z"}], "thread_id": "Thread-1", "execution_time": 0.3430941104888916, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:35.262029Z", "completed_at": "2022-05-19T18:11:35.636057Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:35.636343Z", "completed_at": "2022-05-19T18:11:35.636351Z"}], "thread_id": "Thread-1", "execution_time": 0.3752858638763428, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:35.637838Z", "completed_at": "2022-05-19T18:11:35.960274Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:35.960579Z", "completed_at": "2022-05-19T18:11:35.960589Z"}], "thread_id": "Thread-1", "execution_time": 0.32340502738952637, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:35.961797Z", "completed_at": "2022-05-19T18:11:36.266173Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:36.266601Z", "completed_at": "2022-05-19T18:11:36.266613Z"}], "thread_id": "Thread-1", "execution_time": 0.3056967258453369, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:36.268261Z", "completed_at": "2022-05-19T18:11:36.591829Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:36.592278Z", "completed_at": "2022-05-19T18:11:36.592290Z"}], "thread_id": "Thread-1", "execution_time": 0.3249778747558594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:36.593907Z", "completed_at": "2022-05-19T18:11:36.916339Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:36.916761Z", "completed_at": "2022-05-19T18:11:36.916773Z"}], "thread_id": "Thread-1", "execution_time": 0.32395005226135254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:36.918513Z", "completed_at": "2022-05-19T18:11:37.248581Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:37.249037Z", "completed_at": "2022-05-19T18:11:37.249049Z"}], "thread_id": "Thread-1", "execution_time": 0.3316619396209717, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:37.250637Z", "completed_at": "2022-05-19T18:11:37.589776Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:37.590222Z", "completed_at": "2022-05-19T18:11:37.590234Z"}], "thread_id": "Thread-1", "execution_time": 0.3406252861022949, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:37.592005Z", "completed_at": "2022-05-19T18:11:37.930520Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:37.930977Z", "completed_at": "2022-05-19T18:11:37.930990Z"}], "thread_id": "Thread-1", "execution_time": 0.34000611305236816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:37.932738Z", "completed_at": "2022-05-19T18:11:38.260163Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:38.260638Z", "completed_at": "2022-05-19T18:11:38.260651Z"}], "thread_id": "Thread-1", "execution_time": 0.3290421962738037, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_account"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:38.262406Z", "completed_at": "2022-05-19T18:11:38.583155Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:38.583597Z", "completed_at": "2022-05-19T18:11:38.583609Z"}], "thread_id": "Thread-1", "execution_time": 0.3221921920776367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:38.585344Z", "completed_at": "2022-05-19T18:11:38.917813Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:38.918265Z", "completed_at": "2022-05-19T18:11:38.918277Z"}], "thread_id": "Thread-1", "execution_time": 0.33402395248413086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:38.919972Z", "completed_at": "2022-05-19T18:11:39.240874Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.241334Z", "completed_at": "2022-05-19T18:11:39.241346Z"}], "thread_id": "Thread-1", "execution_time": 0.32234907150268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.243135Z", "completed_at": "2022-05-19T18:11:39.580063Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.580503Z", "completed_at": "2022-05-19T18:11:39.580515Z"}], "thread_id": "Thread-1", "execution_time": 0.3385148048400879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_territory"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.582280Z", "completed_at": "2022-05-19T18:11:39.594760Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.595209Z", "completed_at": "2022-05-19T18:11:39.595221Z"}], "thread_id": "Thread-1", "execution_time": 0.014052152633666992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.596816Z", "completed_at": "2022-05-19T18:11:39.609872Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.610264Z", "completed_at": "2022-05-19T18:11:39.610274Z"}], "thread_id": "Thread-1", "execution_time": 0.014466047286987305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.625168Z", "completed_at": "2022-05-19T18:11:39.630848Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.631203Z", "completed_at": "2022-05-19T18:11:39.631211Z"}], "thread_id": "Thread-1", "execution_time": 0.0067899227142333984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.632406Z", "completed_at": "2022-05-19T18:11:39.640454Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.640806Z", "completed_at": "2022-05-19T18:11:39.640814Z"}], "thread_id": "Thread-1", "execution_time": 0.009258031845092773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.656206Z", "completed_at": "2022-05-19T18:11:39.660836Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.661151Z", "completed_at": "2022-05-19T18:11:39.661158Z"}], "thread_id": "Thread-1", "execution_time": 0.0055370330810546875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.667977Z", "completed_at": "2022-05-19T18:11:39.674607Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.675048Z", "completed_at": "2022-05-19T18:11:39.675056Z"}], "thread_id": "Thread-1", "execution_time": 0.008005857467651367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.677010Z", "completed_at": "2022-05-19T18:11:39.682921Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.683300Z", "completed_at": "2022-05-19T18:11:39.683309Z"}], "thread_id": "Thread-1", "execution_time": 0.007383823394775391, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.694553Z", "completed_at": "2022-05-19T18:11:39.700505Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.700863Z", "completed_at": "2022-05-19T18:11:39.700872Z"}], "thread_id": "Thread-1", "execution_time": 0.007180929183959961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.702120Z", "completed_at": "2022-05-19T18:11:39.707506Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.707801Z", "completed_at": "2022-05-19T18:11:39.707807Z"}], "thread_id": "Thread-1", "execution_time": 0.006384849548339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.708821Z", "completed_at": "2022-05-19T18:11:39.714051Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.714393Z", "completed_at": "2022-05-19T18:11:39.714400Z"}], "thread_id": "Thread-1", "execution_time": 0.006223917007446289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.715546Z", "completed_at": "2022-05-19T18:11:39.720275Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.720585Z", "completed_at": "2022-05-19T18:11:39.720592Z"}], "thread_id": "Thread-1", "execution_time": 0.005728006362915039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.721748Z", "completed_at": "2022-05-19T18:11:39.727057Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.727402Z", "completed_at": "2022-05-19T18:11:39.727409Z"}], "thread_id": "Thread-1", "execution_time": 0.006302833557128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.738892Z", "completed_at": "2022-05-19T18:11:39.743584Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.743868Z", "completed_at": "2022-05-19T18:11:39.743875Z"}], "thread_id": "Thread-1", "execution_time": 0.005635738372802734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.744878Z", "completed_at": "2022-05-19T18:11:39.752545Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.752839Z", "completed_at": "2022-05-19T18:11:39.752847Z"}], "thread_id": "Thread-1", "execution_time": 0.008614063262939453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__territory_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.754172Z", "completed_at": "2022-05-19T18:11:39.759775Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.760080Z", "completed_at": "2022-05-19T18:11:39.760088Z"}], "thread_id": "Thread-1", "execution_time": 0.006793975830078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.761143Z", "completed_at": "2022-05-19T18:11:39.787167Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.787517Z", "completed_at": "2022-05-19T18:11:39.787526Z"}], "thread_id": "Thread-1", "execution_time": 0.02706313133239746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__app_version_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.788671Z", "completed_at": "2022-05-19T18:11:39.822761Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.823063Z", "completed_at": "2022-05-19T18:11:39.823071Z"}], "thread_id": "Thread-1", "execution_time": 0.03505420684814453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__device_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.824162Z", "completed_at": "2022-05-19T18:11:39.854115Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.854507Z", "completed_at": "2022-05-19T18:11:39.854516Z"}], "thread_id": "Thread-1", "execution_time": 0.031004905700683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__platform_version_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.855593Z", "completed_at": "2022-05-19T18:11:39.878583Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.878867Z", "completed_at": "2022-05-19T18:11:39.878875Z"}], "thread_id": "Thread-1", "execution_time": 0.0239260196685791, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__overview_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.879961Z", "completed_at": "2022-05-19T18:11:39.900681Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.900962Z", "completed_at": "2022-05-19T18:11:39.900970Z"}], "thread_id": "Thread-1", "execution_time": 0.021650075912475586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__source_type_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.902049Z", "completed_at": "2022-05-19T18:11:39.906863Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.907372Z", "completed_at": "2022-05-19T18:11:39.907380Z"}], "thread_id": "Thread-1", "execution_time": 0.006347179412841797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.909206Z", "completed_at": "2022-05-19T18:11:39.914233Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.914599Z", "completed_at": "2022-05-19T18:11:39.914607Z"}], "thread_id": "Thread-1", "execution_time": 0.006101131439208984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.915773Z", "completed_at": "2022-05-19T18:11:39.921898Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.922278Z", "completed_at": "2022-05-19T18:11:39.922287Z"}], "thread_id": "Thread-1", "execution_time": 0.007265806198120117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.923499Z", "completed_at": "2022-05-19T18:11:39.928682Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.929048Z", "completed_at": "2022-05-19T18:11:39.929056Z"}], "thread_id": "Thread-1", "execution_time": 0.006263017654418945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.930110Z", "completed_at": "2022-05-19T18:11:39.934982Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.935379Z", "completed_at": "2022-05-19T18:11:39.935387Z"}], "thread_id": "Thread-1", "execution_time": 0.00590205192565918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-19T18:11:39.936531Z", "completed_at": "2022-05-19T18:11:39.942239Z"}, {"name": "execute", "started_at": "2022-05-19T18:11:39.942520Z", "completed_at": "2022-05-19T18:11:39.942528Z"}], "thread_id": "Thread-1", "execution_time": 0.0068280696868896484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092"}], "elapsed_time": 8.305613994598389, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/sheri.nguyen/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-05-31T22:13:49.619889Z", "invocation_id": "155a3a3c-5eb4-42e2-a4c8-3b52c18055f6", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.713518Z", "completed_at": "2022-05-31T22:13:43.727216Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.727734Z", "completed_at": "2022-05-31T22:13:43.727765Z"}], "thread_id": "Thread-1", "execution_time": 0.015463113784790039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_device_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.729724Z", "completed_at": "2022-05-31T22:13:43.734444Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.734890Z", "completed_at": "2022-05-31T22:13:43.734902Z"}], "thread_id": "Thread-1", "execution_time": 0.006178855895996094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.736668Z", "completed_at": "2022-05-31T22:13:43.740943Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.741355Z", "completed_at": "2022-05-31T22:13:43.741365Z"}], "thread_id": "Thread-1", "execution_time": 0.005894184112548828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.743160Z", "completed_at": "2022-05-31T22:13:43.747266Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.747690Z", "completed_at": "2022-05-31T22:13:43.747700Z"}], "thread_id": "Thread-1", "execution_time": 0.005815982818603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.749316Z", "completed_at": "2022-05-31T22:13:43.753368Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.753749Z", "completed_at": "2022-05-31T22:13:43.753758Z"}], "thread_id": "Thread-1", "execution_time": 0.00533294677734375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.755261Z", "completed_at": "2022-05-31T22:13:43.758980Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.759321Z", "completed_at": "2022-05-31T22:13:43.759329Z"}], "thread_id": "Thread-1", "execution_time": 0.0050809383392333984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.760718Z", "completed_at": "2022-05-31T22:13:43.765258Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.765612Z", "completed_at": "2022-05-31T22:13:43.765620Z"}], "thread_id": "Thread-1", "execution_time": 0.005733013153076172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_device_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.766948Z", "completed_at": "2022-05-31T22:13:43.770295Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.770633Z", "completed_at": "2022-05-31T22:13:43.770640Z"}], "thread_id": "Thread-1", "execution_time": 0.004535198211669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.771925Z", "completed_at": "2022-05-31T22:13:43.775225Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.775563Z", "completed_at": "2022-05-31T22:13:43.775572Z"}], "thread_id": "Thread-1", "execution_time": 0.004397869110107422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.776863Z", "completed_at": "2022-05-31T22:13:43.780237Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.780577Z", "completed_at": "2022-05-31T22:13:43.780586Z"}], "thread_id": "Thread-1", "execution_time": 0.004554033279418945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_account_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.781965Z", "completed_at": "2022-05-31T22:13:43.785534Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.785843Z", "completed_at": "2022-05-31T22:13:43.785850Z"}], "thread_id": "Thread-1", "execution_time": 0.00472712516784668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_events_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.787106Z", "completed_at": "2022-05-31T22:13:43.790308Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.790811Z", "completed_at": "2022-05-31T22:13:43.790817Z"}], "thread_id": "Thread-1", "execution_time": 0.004518985748291016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_summary_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.791873Z", "completed_at": "2022-05-31T22:13:43.795619Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.795911Z", "completed_at": "2022-05-31T22:13:43.795918Z"}], "thread_id": "Thread-1", "execution_time": 0.004790067672729492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.796990Z", "completed_at": "2022-05-31T22:13:43.832248Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.832691Z", "completed_at": "2022-05-31T22:13:43.832703Z"}], "thread_id": "Thread-1", "execution_time": 0.03653073310852051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_device_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.834439Z", "completed_at": "2022-05-31T22:13:43.838688Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.839123Z", "completed_at": "2022-05-31T22:13:43.839134Z"}], "thread_id": "Thread-1", "execution_time": 0.005784034729003906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.840836Z", "completed_at": "2022-05-31T22:13:43.844911Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.845347Z", "completed_at": "2022-05-31T22:13:43.845357Z"}], "thread_id": "Thread-1", "execution_time": 0.005575895309448242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_territory_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.846979Z", "completed_at": "2022-05-31T22:13:43.849243Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.849634Z", "completed_at": "2022-05-31T22:13:43.849643Z"}], "thread_id": "Thread-1", "execution_time": 0.0036590099334716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.851089Z", "completed_at": "2022-05-31T22:13:43.853131Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.853513Z", "completed_at": "2022-05-31T22:13:43.853522Z"}], "thread_id": "Thread-1", "execution_time": 0.003386974334716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app_store_platform_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.855033Z", "completed_at": "2022-05-31T22:13:43.857009Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.857390Z", "completed_at": "2022-05-31T22:13:43.857399Z"}], "thread_id": "Thread-1", "execution_time": 0.0032529830932617188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app_store_source_type_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.858784Z", "completed_at": "2022-05-31T22:13:43.861836Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.862165Z", "completed_at": "2022-05-31T22:13:43.862173Z"}], "thread_id": "Thread-1", "execution_time": 0.004197120666503906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.app_store_territory_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.863421Z", "completed_at": "2022-05-31T22:13:43.865183Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.865507Z", "completed_at": "2022-05-31T22:13:43.865515Z"}], "thread_id": "Thread-1", "execution_time": 0.0028548240661621094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.crashes_app_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.866728Z", "completed_at": "2022-05-31T22:13:43.868480Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.868802Z", "completed_at": "2022-05-31T22:13:43.868810Z"}], "thread_id": "Thread-1", "execution_time": 0.002830982208251953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.crashes_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.870008Z", "completed_at": "2022-05-31T22:13:43.871699Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.872034Z", "completed_at": "2022-05-31T22:13:43.872042Z"}], "thread_id": "Thread-1", "execution_time": 0.0027849674224853516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.downloads_platform_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.873346Z", "completed_at": "2022-05-31T22:13:43.875076Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.875392Z", "completed_at": "2022-05-31T22:13:43.875399Z"}], "thread_id": "Thread-1", "execution_time": 0.0029540061950683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.downloads_source_type_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.876595Z", "completed_at": "2022-05-31T22:13:43.878376Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.878705Z", "completed_at": "2022-05-31T22:13:43.878713Z"}], "thread_id": "Thread-1", "execution_time": 0.0028820037841796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.downloads_territory_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.879935Z", "completed_at": "2022-05-31T22:13:43.881676Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.882001Z", "completed_at": "2022-05-31T22:13:43.882009Z"}], "thread_id": "Thread-1", "execution_time": 0.002830028533935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.sales_account"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.883216Z", "completed_at": "2022-05-31T22:13:43.885983Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.886306Z", "completed_at": "2022-05-31T22:13:43.886313Z"}], "thread_id": "Thread-1", "execution_time": 0.003904104232788086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.sales_subscription_events"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.887584Z", "completed_at": "2022-05-31T22:13:43.889244Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.889554Z", "completed_at": "2022-05-31T22:13:43.889562Z"}], "thread_id": "Thread-1", "execution_time": 0.0027370452880859375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.sales_subscription_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.890700Z", "completed_at": "2022-05-31T22:13:43.892299Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.892586Z", "completed_at": "2022-05-31T22:13:43.892593Z"}], "thread_id": "Thread-1", "execution_time": 0.002590179443359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_app_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.893643Z", "completed_at": "2022-05-31T22:13:43.895111Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.895376Z", "completed_at": "2022-05-31T22:13:43.895383Z"}], "thread_id": "Thread-1", "execution_time": 0.002371072769165039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_platform_version_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.896367Z", "completed_at": "2022-05-31T22:13:43.897771Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.898027Z", "completed_at": "2022-05-31T22:13:43.898033Z"}], "thread_id": "Thread-1", "execution_time": 0.002269268035888672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_source_type_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.899013Z", "completed_at": "2022-05-31T22:13:43.900365Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.900624Z", "completed_at": "2022-05-31T22:13:43.900631Z"}], "thread_id": "Thread-1", "execution_time": 0.0022590160369873047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_integration_tests.usage_territory_source_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.901649Z", "completed_at": "2022-05-31T22:13:43.903147Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:43.903409Z", "completed_at": "2022-05-31T22:13:43.903415Z"}], "thread_id": "Thread-1", "execution_time": 0.0023772716522216797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.apple_store_source.apple_store_country_codes"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:43.905343Z", "completed_at": "2022-05-31T22:13:44.237487Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:44.237856Z", "completed_at": "2022-05-31T22:13:44.237868Z"}], "thread_id": "Thread-1", "execution_time": 0.33415889739990234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:44.239336Z", "completed_at": "2022-05-31T22:13:44.613873Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:44.614598Z", "completed_at": "2022-05-31T22:13:44.614614Z"}], "thread_id": "Thread-1", "execution_time": 0.3763699531555176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:44.616750Z", "completed_at": "2022-05-31T22:13:44.892744Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:44.893080Z", "completed_at": "2022-05-31T22:13:44.893090Z"}], "thread_id": "Thread-1", "execution_time": 0.27779293060302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app_store_territory"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:44.894712Z", "completed_at": "2022-05-31T22:13:45.210060Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:45.210486Z", "completed_at": "2022-05-31T22:13:45.210498Z"}], "thread_id": "Thread-1", "execution_time": 0.31656765937805176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__app"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:45.212200Z", "completed_at": "2022-05-31T22:13:45.513163Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:45.513602Z", "completed_at": "2022-05-31T22:13:45.513615Z"}], "thread_id": "Thread-1", "execution_time": 0.3026151657104492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_app_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:45.515417Z", "completed_at": "2022-05-31T22:13:45.813929Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:45.814375Z", "completed_at": "2022-05-31T22:13:45.814387Z"}], "thread_id": "Thread-1", "execution_time": 0.3001410961151123, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__crashes_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:45.816147Z", "completed_at": "2022-05-31T22:13:46.135014Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:46.135475Z", "completed_at": "2022-05-31T22:13:46.135488Z"}], "thread_id": "Thread-1", "execution_time": 0.3204631805419922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:46.137264Z", "completed_at": "2022-05-31T22:13:46.456944Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:46.457397Z", "completed_at": "2022-05-31T22:13:46.457410Z"}], "thread_id": "Thread-1", "execution_time": 0.3212900161743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:46.459102Z", "completed_at": "2022-05-31T22:13:46.774766Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:46.775219Z", "completed_at": "2022-05-31T22:13:46.775233Z"}], "thread_id": "Thread-1", "execution_time": 0.3171041011810303, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__downloads_territory"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:46.776909Z", "completed_at": "2022-05-31T22:13:47.080162Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:47.080644Z", "completed_at": "2022-05-31T22:13:47.080658Z"}], "thread_id": "Thread-1", "execution_time": 0.304718017578125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_account"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:47.082405Z", "completed_at": "2022-05-31T22:13:47.446825Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:47.447222Z", "completed_at": "2022-05-31T22:13:47.447234Z"}], "thread_id": "Thread-1", "execution_time": 0.36575794219970703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_events"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:47.448771Z", "completed_at": "2022-05-31T22:13:47.834834Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:47.835200Z", "completed_at": "2022-05-31T22:13:47.835211Z"}], "thread_id": "Thread-1", "execution_time": 0.3874030113220215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__sales_subscription_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:47.836646Z", "completed_at": "2022-05-31T22:13:48.186786Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:48.187231Z", "completed_at": "2022-05-31T22:13:48.187244Z"}], "thread_id": "Thread-1", "execution_time": 0.35158801078796387, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_app_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:48.188929Z", "completed_at": "2022-05-31T22:13:48.486707Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:48.487159Z", "completed_at": "2022-05-31T22:13:48.487172Z"}], "thread_id": "Thread-1", "execution_time": 0.29920411109924316, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_device"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:48.488728Z", "completed_at": "2022-05-31T22:13:48.789440Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:48.789890Z", "completed_at": "2022-05-31T22:13:48.789903Z"}], "thread_id": "Thread-1", "execution_time": 0.3022172451019287, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_platform_version"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:48.791553Z", "completed_at": "2022-05-31T22:13:49.142515Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.142880Z", "completed_at": "2022-05-31T22:13:49.142891Z"}], "thread_id": "Thread-1", "execution_time": 0.3523671627044678, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store_source.stg_apple_store__usage_territory"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.155434Z", "completed_at": "2022-05-31T22:13:49.170236Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.170597Z", "completed_at": "2022-05-31T22:13:49.170607Z"}], "thread_id": "Thread-1", "execution_time": 0.01596212387084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_device_date_day__app_id__source_type__device.b68460b067"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.171868Z", "completed_at": "2022-05-31T22:13:49.179442Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.179788Z", "completed_at": "2022-05-31T22:13:49.179797Z"}], "thread_id": "Thread-1", "execution_time": 0.008701086044311523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_platform_version_date_day__app_id__source_type__platform_version.80fbd35d7a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.181075Z", "completed_at": "2022-05-31T22:13:49.188395Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.188750Z", "completed_at": "2022-05-31T22:13:49.188758Z"}], "thread_id": "Thread-1", "execution_time": 0.008432149887084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__app_store_territory_date_day__app_id__source_type__territory.7cdae53c6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.189934Z", "completed_at": "2022-05-31T22:13:49.195453Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.195738Z", "completed_at": "2022-05-31T22:13:49.195746Z"}], "thread_id": "Thread-1", "execution_time": 0.00650787353515625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.unique_stg_apple_store__app_app_id.d811c134aa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.211066Z", "completed_at": "2022-05-31T22:13:49.218108Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.218438Z", "completed_at": "2022-05-31T22:13:49.218448Z"}], "thread_id": "Thread-1", "execution_time": 0.008049964904785156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_app_version_date_day__app_id__device__app_version.d812a1af75"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.225394Z", "completed_at": "2022-05-31T22:13:49.230732Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.231036Z", "completed_at": "2022-05-31T22:13:49.231043Z"}], "thread_id": "Thread-1", "execution_time": 0.006548881530761719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__crashes_platform_version_date_day__app_id__device__platform_version.94808fafb3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.241682Z", "completed_at": "2022-05-31T22:13:49.246706Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.247056Z", "completed_at": "2022-05-31T22:13:49.247066Z"}], "thread_id": "Thread-1", "execution_time": 0.0062160491943359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_device_date_day__app_id__source_type__device.5d2738acd2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.248293Z", "completed_at": "2022-05-31T22:13:49.255080Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.255439Z", "completed_at": "2022-05-31T22:13:49.255447Z"}], "thread_id": "Thread-1", "execution_time": 0.007796049118041992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_platform_version_date_day__app_id__source_type__platform_version.35be5774dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.256488Z", "completed_at": "2022-05-31T22:13:49.262047Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.262644Z", "completed_at": "2022-05-31T22:13:49.262654Z"}], "thread_id": "Thread-1", "execution_time": 0.006894826889038086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__downloads_territory_date_day__app_id__source_type__territory.d61d29a8f6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.263783Z", "completed_at": "2022-05-31T22:13:49.267279Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.267615Z", "completed_at": "2022-05-31T22:13:49.267622Z"}], "thread_id": "Thread-1", "execution_time": 0.004483699798583984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.unique_stg_apple_store__sales_account_account_id.da7b3695e8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.281673Z", "completed_at": "2022-05-31T22:13:49.288007Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.288294Z", "completed_at": "2022-05-31T22:13:49.288302Z"}], "thread_id": "Thread-1", "execution_time": 0.0073719024658203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_events_date_day__account_id__app_name__subscription_name__device__event__country__state.bea0346a67"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.309596Z", "completed_at": "2022-05-31T22:13:49.315349Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.315635Z", "completed_at": "2022-05-31T22:13:49.315643Z"}], "thread_id": "Thread-1", "execution_time": 0.006685018539428711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__sales_subscription_summary_date_day__account_id__app_name__subscription_name__device__country__state.1e5fa4e8a4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.316753Z", "completed_at": "2022-05-31T22:13:49.322158Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.322454Z", "completed_at": "2022-05-31T22:13:49.322462Z"}], "thread_id": "Thread-1", "execution_time": 0.006477832794189453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_app_version_date_day__app_id__source_type__app_version.05a3d415a2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.333079Z", "completed_at": "2022-05-31T22:13:49.338410Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.338723Z", "completed_at": "2022-05-31T22:13:49.338733Z"}], "thread_id": "Thread-1", "execution_time": 0.006318092346191406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_device_date_day__app_id__source_type__device.b45a8a5145"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.339811Z", "completed_at": "2022-05-31T22:13:49.346580Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.346880Z", "completed_at": "2022-05-31T22:13:49.346888Z"}], "thread_id": "Thread-1", "execution_time": 0.007735013961791992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_platform_version_date_day__app_id__source_type__platform_version.1231bf88e6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.347939Z", "completed_at": "2022-05-31T22:13:49.355031Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.355352Z", "completed_at": "2022-05-31T22:13:49.355361Z"}], "thread_id": "Thread-1", "execution_time": 0.008105039596557617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__territory_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.356663Z", "completed_at": "2022-05-31T22:13:49.362015Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.362310Z", "completed_at": "2022-05-31T22:13:49.362317Z"}], "thread_id": "Thread-1", "execution_time": 0.006314992904663086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store_source.dbt_utils_unique_combination_of_columns_stg_apple_store__usage_territory_date_day__app_id__source_type__territory.8e3efb4939"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.363532Z", "completed_at": "2022-05-31T22:13:49.389510Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.389826Z", "completed_at": "2022-05-31T22:13:49.389836Z"}], "thread_id": "Thread-1", "execution_time": 0.026989221572875977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__app_version_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.390989Z", "completed_at": "2022-05-31T22:13:49.422427Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.422733Z", "completed_at": "2022-05-31T22:13:49.422742Z"}], "thread_id": "Thread-1", "execution_time": 0.032438039779663086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__platform_version_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.423900Z", "completed_at": "2022-05-31T22:13:49.453616Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.453929Z", "completed_at": "2022-05-31T22:13:49.453939Z"}], "thread_id": "Thread-1", "execution_time": 0.030726194381713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__subscription_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.472954Z", "completed_at": "2022-05-31T22:13:49.514677Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.514988Z", "completed_at": "2022-05-31T22:13:49.514996Z"}], "thread_id": "Thread-1", "execution_time": 0.0428318977355957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__device_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.516117Z", "completed_at": "2022-05-31T22:13:49.535582Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.536367Z", "completed_at": "2022-05-31T22:13:49.536377Z"}], "thread_id": "Thread-1", "execution_time": 0.02094411849975586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__source_type_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.537547Z", "completed_at": "2022-05-31T22:13:49.542430Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.542705Z", "completed_at": "2022-05-31T22:13:49.542712Z"}], "thread_id": "Thread-1", "execution_time": 0.0059719085693359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__territory_report_date_day__app_id__source_type__territory_long.9a1eb640a6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.543669Z", "completed_at": "2022-05-31T22:13:49.548881Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.549196Z", "completed_at": "2022-05-31T22:13:49.549204Z"}], "thread_id": "Thread-1", "execution_time": 0.006144046783447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__app_version_report_date_day__app_id__source_type__app_version.de63f831ca"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.550418Z", "completed_at": "2022-05-31T22:13:49.558444Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.558849Z", "completed_at": "2022-05-31T22:13:49.558859Z"}], "thread_id": "Thread-1", "execution_time": 0.00910806655883789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__platform_version_report_date_day__app_id__source_type__platform_version.a14b116d68"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.560223Z", "completed_at": "2022-05-31T22:13:49.566187Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.566587Z", "completed_at": "2022-05-31T22:13:49.566595Z"}], "thread_id": "Thread-1", "execution_time": 0.007241010665893555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__subscription_report_date_day__account_id__app_id__subscription_name__territory_long__state.c29f4d07e9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.568013Z", "completed_at": "2022-05-31T22:13:49.599000Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.599300Z", "completed_at": "2022-05-31T22:13:49.599310Z"}], "thread_id": "Thread-1", "execution_time": 0.03219199180603027, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.apple_store.apple_store__overview_report"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.600439Z", "completed_at": "2022-05-31T22:13:49.605309Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.605599Z", "completed_at": "2022-05-31T22:13:49.605606Z"}], "thread_id": "Thread-1", "execution_time": 0.0058019161224365234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__device_report_date_day__app_id__source_type__device.d5cfe96996"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.606598Z", "completed_at": "2022-05-31T22:13:49.612124Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.612409Z", "completed_at": "2022-05-31T22:13:49.612417Z"}], "thread_id": "Thread-1", "execution_time": 0.006435871124267578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__source_type_report_date_day__app_id__source_type.75593c9092"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-05-31T22:13:49.613429Z", "completed_at": "2022-05-31T22:13:49.618013Z"}, {"name": "execute", "started_at": "2022-05-31T22:13:49.618355Z", "completed_at": "2022-05-31T22:13:49.618363Z"}], "thread_id": "Thread-1", "execution_time": 0.005580902099609375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.apple_store.dbt_utils_unique_combination_of_columns_apple_store__overview_report_date_day__app_id.1301a19968"}], "elapsed_time": 9.350184202194214, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/sheri.nguyen/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 9602d5f..0151a9e 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -7,6 +7,7 @@ profile: 'integration_tests' vars: apple_store_schema: apple_store_integration_tests + apple_store__using_subscriptions: True apple_store_source: app_identifier: "app" app_store_platform_version_source_type_report_identifier: "app_store_platform_version_source_type" From 396bb3e3ebb5d74799f92f4cf6636c041eceec8c Mon Sep 17 00:00:00 2001 From: fivetran-sheringuyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Tue, 31 May 2022 21:52:04 -0500 Subject: [PATCH 3/3] updating packages --- packages.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages.yml b/packages.yml index 8832566..e744812 100644 --- a/packages.yml +++ b/packages.yml @@ -1,5 +1,3 @@ packages: -## edit before release - - git: https://github.com/fivetran/dbt_apple_store_source.git - revision: main - warn-unpinned: false \ No newline at end of file + - package: fivetran/apple_store_source + version: [">=0.1.0", "<0.2.0"] \ No newline at end of file