From 4504bd29fe2acfe5bb87f8485b9eb84b1b7149fa Mon Sep 17 00:00:00 2001
From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
Date: Tue, 23 Jul 2024 10:16:48 -0500
Subject: [PATCH 01/12] MagicBot/2024-q3-updates updates
---
.buildkite/hooks/pre-command | 4 +-
.buildkite/pipeline.yml | 17 +++++-
.buildkite/scripts/run_models.sh | 18 ++++++
CHANGELOG.md | 15 +++++
README.md | 58 +++++++++----------
dbt_project.yml | 2 +-
integration_tests/ci/sample.profiles.yml | 10 +++-
integration_tests/dbt_project.yml | 7 ++-
macros/is_incremental_compatible.sql | 17 ++++++
models/mixpanel__daily_events.sql | 4 +-
models/mixpanel__event.sql | 4 +-
models/mixpanel__monthly_events.sql | 4 +-
models/mixpanel__sessions.sql | 4 +-
.../stg_mixpanel__user_event_date_spine.sql | 4 +-
packages.yml | 4 ++
15 files changed, 128 insertions(+), 44 deletions(-)
create mode 100644 macros/is_incremental_compatible.sql
diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command
index 81b7b00..3417274 100644
--- a/.buildkite/hooks/pre-command
+++ b/.buildkite/hooks/pre-command
@@ -22,4 +22,6 @@ export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secr
export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917")
export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917")
export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917")
-export CI_DATABRICKS_DBT_CATALOG=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_CATALOG" --project="dbt-package-testing-363917")
\ No newline at end of file
+export CI_DATABRICKS_DBT_CATALOG=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_CATALOG" --project="dbt-package-testing-363917")
+export CI_DATABRICKS_SQL_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_SQL_DBT_HTTP_PATH" --project="dbt-package-testing-363917")
+export CI_DATABRICKS_SQL_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_SQL_DBT_TOKEN" --project="dbt-package-testing-363917")
\ No newline at end of file
diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index 1f4f997..479fae9 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -71,4 +71,19 @@ steps:
- "CI_DATABRICKS_DBT_TOKEN"
- "CI_DATABRICKS_DBT_CATALOG"
commands: |
- bash .buildkite/scripts/run_models.sh databricks
\ No newline at end of file
+ bash .buildkite/scripts/run_models.sh databricks
+
+ - label: ":databricks: :database: Run Tests - Databricks SQL Warehouse"
+ key: "run_dbt_databricks_sql"
+ plugins:
+ - docker#v3.13.0:
+ image: "python:3.8"
+ shell: [ "/bin/bash", "-e", "-c" ]
+ environment:
+ - "BASH_ENV=/tmp/.bashrc"
+ - "CI_DATABRICKS_DBT_HOST"
+ - "CI_DATABRICKS_SQL_DBT_HTTP_PATH"
+ - "CI_DATABRICKS_SQL_DBT_TOKEN"
+ - "CI_DATABRICKS_DBT_CATALOG"
+ commands: |
+ bash .buildkite/scripts/run_models.sh databricks-sql
\ No newline at end of file
diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh
index ce70234..cbc275c 100644
--- a/.buildkite/scripts/run_models.sh
+++ b/.buildkite/scripts/run_models.sh
@@ -16,9 +16,27 @@ db=$1
echo `pwd`
cd integration_tests
dbt deps
+if [ "$db" = "databricks-sql" ]; then
+dbt seed --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db" --full-refresh
+dbt compile --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db" --full-refresh
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
+dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: true}' --target "$db" --full-refresh
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: true}' --target "$db"
+dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__credits_pricing: false, fivetran_platform__usage_pricing: true}' --target "$db" --full-refresh
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__credits_pricing: false, fivetran_platform__usage_pricing: true}' --target "$db"
+dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: false, fivetran_platform_using_destination_membership: false, fivetran_platform_using_user: false}' --target "$db" --full-refresh
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: false, fivetran_platform_using_destination_membership: false, fivetran_platform_using_user: false}' --target "$db"
+dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
+else
dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --target "$db"
dbt test --target "$db"
dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
+
+fi
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 44f7523..6b59a33 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,18 @@
+# dbt_mixpanel v0.10.0
+
+[PR #48](https://github.com/fivetran/dbt_mixpanel/pull/48) includes the following updates:
+
+## 🚨 Breaking Changes 🚨
+> ⚠️ Since the following changes result in the table format changing, we recommend running a `--full-refresh` after upgrading to this version to avoid possible incremental failures.
+
+- For Databricks All-Purpose clusters, incremental models will now be materialized using the delta table format (previously parquet).
+ - Delta tables are generally more performant than parquet and are also more widely available for Databricks users. This will also prevent compilation issues on customers' managed tables.
+
+- For Databricks SQL Warehouses, incremental materialization will not be used due to the incompatibility of the `insert_overwrite` strategy.
+
+## Under the Hood
+- The `is_databricks_sql_warehouse` has been added to return `true` if the Databricks runtime being used is an all-purpose cluster **or** if any other Databricks non-supported destination is being used.
+ - This update was applied as there have been other Databricks runtimes discovered (ie. an endpoint and external runtime) which do not support the `insert_overwrite` incremental strategy used.
# dbt_mixpanel v0.9.0
[PR #41](https://github.com/fivetran/dbt_mixpanel/pull/41) includes the following updates:
diff --git a/README.md b/README.md
index bb6f435..6d8f031 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
# Mixpanel dbt Package ([Docs](https://fivetran.github.io/dbt_mixpanel/))
-# 📣 What does this dbt package do?
+## 📣 What does this dbt package do?
- Produces modeled tables that leverage Mixpanel data from [Fivetran's connector](https://fivetran.com/docs/applications/mixpanel). It uses the Mixpanel `event` table in the format described by [this ERD](https://fivetran.com/docs/applications/mixpanel#schemainformation).
@@ -39,15 +39,15 @@ The following table provides a detailed list of all models materialized within t
-# 🎯 How do I use the dbt package?
+## 🎯 How do I use the dbt package?
-## Step 1: Prerequisites
+### Step 1: Prerequisites
To use this dbt package, you must have the following:
- At least one Fivetran Mixpanel connector syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
-### Databricks dispatch configuration
+#### Databricks dispatch configuration
If you are using a Databricks destination with this package, you must add the following (or a variation of the following) dispatch configuration within your `dbt_project.yml`. This is required in order for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively.
```yml
dispatch:
@@ -55,7 +55,7 @@ dispatch:
search_order: ['spark_utils', 'dbt_utils']
```
-### Database Incremental Strategies
+#### Database Incremental Strategies
Many of the end models in this package are materialized incrementally, so we have configured our models to work with the different strategies available to each supported warehouse.
For **BigQuery** and **Databricks** destinations, we have chosen `insert_overwrite` as the default strategy, which benefits from the partitioning capability.
@@ -64,7 +64,7 @@ For **Snowflake**, **Redshift**, and **Postgres** databases, we have chosen `del
> Regardless of strategy, we recommend that users periodically run a `--full-refresh` to ensure a high level of data quality.
-## Step 2: Install the package
+### Step 2: Install the package
Include the following mixpanel package version in your `packages.yml` file:
> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.
@@ -74,7 +74,7 @@ packages:
version: [">=0.9.0", "<0.10.0"] # we recommend using ranges to capture non-breaking changes automatically
```
-## Step 3: Define database and schema variables
+### Step 3: Define database and schema variables
By default, this package runs using your destination and the `mixpanel` schema. If this is not where your Mixpanel data is (for example, if your Mixpanel schema is named `mixpanel_fivetran`), add the following configuration to your root `dbt_project.yml` file:
```yml
@@ -83,10 +83,10 @@ vars:
mixpanel_schema: your_schema_name
```
-## (Optional) Step 4: Additional configurations
+### (Optional) Step 4: Additional configurations
-## Macros
-### analyze_funnel [(source)](https://github.com/fivetran/dbt_mixpanel/blob/master/macros/analyze_funnel.sql)
+### Macros
+#### analyze_funnel [(source)](https://github.com/fivetran/dbt_mixpanel/blob/master/macros/analyze_funnel.sql)
You can use the `analyze_funnel(event_funnel, group_by_column, conversion_criteria)` macro to produce a funnel between a given list of event types.
It returns the following:
@@ -103,7 +103,7 @@ The macro takes the following as arguments:
- `conversion_criteria`: (Optional) A `WHERE` clause that will be applied when selecting from `mixpanel__event`.
- Example: To limit all events in the funnel to the United States, you'd provide `conversion_criteria = 'country_code = "US"'`. To limit the events to only song play events to the US, you'd input `conversion_criteria = 'country_code = "US"' OR event_type != 'play_song'`.
-### Pivoting Out Event Properties
+#### Pivoting Out Event Properties
By default, this package selects the [default columns collected by Mixpanel](https://help.mixpanel.com/hc/en-us/articles/115004613766-What-properties-do-Mixpanel-s-libraries-store-by-default-). However, you likely have custom properties or columns that you'd like to include in the `mixpanel__event` model.
If there are properties in the `mixpanel.event.properties` JSON blob that you'd like to pivot out into columns, add the following variable to your `dbt_project.yml` file:
@@ -114,7 +114,7 @@ vars:
event_properties_to_pivot: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
```
-### Passthrough Columns
+#### Passthrough Columns
Additionally, this package includes all standard source `EVENT` columns defined in the `staging_columns` macro. You can add more columns using our passthrough column variables. These variables allow the passthrough fields to be aliased (`alias`) and casted (`transform_sql`) if desired, although it is not required. Data type casting is configured via a SQL snippet within the `transform_sql` key. You may add the desired SQL snippet while omitting the `as field_name` part of the casting statement - this will be dealt with by the alias attribute - and your custom passthrough fields will be casted accordingly.
Use the following format for declaring the respective passthrough variables:
@@ -129,14 +129,14 @@ vars:
- name: "this_other_field"
transform_sql: "cast(this_other_field as string)"
```
-### Sessions Event Frequency Limit
+#### Sessions Event Frequency Limit
The `event_frequencies` field within the `mixpanel__sessions` model reports all event types and the frequency of those events as a JSON blob via a string aggregation. For some users there can be thousands of different event types that take place. For Redshift and Postgres warehouses there currently exists a limit for string aggregations (up to 65,535). As a result, in order for Redshift and Postgres users to still leverage the `event_frequencies` field, an artificial limit is applied to this field of 1,000. If you would like to adjust this limit, you may do so by modifying the below variable in your project configuration.
```yml
vars:
mixpanel:
mixpanel__event_frequency_limit: 500 ## Default is 1000
```
-### Event Date Range
+#### Event Date Range
Because of the typical volume of event data, you may want to limit this package's models to work with a recent date range of your Mixpanel data (however, note that all final models are materialized as [incremental](https://docs.getdbt.com/docs/building-a-dbt-project/building-models/materializations#incremental) tables).
By default, the package looks at all events since January 1, 2010. To change this start date, add the following variable to your `dbt_project.yml` file:
@@ -149,7 +149,7 @@ vars:
**Note:** This date range will not affect the `number_of_new_users` column in the `mixpanel__daily_events` or `mixpanel__monthly_events` models. This metric will be *true* new users.
-### Global Event Filters
+#### Global Event Filters
In addition to limiting the date range, you may want to employ other filters to remove noise from your event data.
To apply a global filter to events (and therefore **all** models in this package), add the following variable to your `dbt_project.yml` file. It will be applied as a `WHERE` clause when selecting from the source table, `mixpanel.event`.
@@ -161,8 +161,8 @@ vars:
global_event_filter: 'distinct_id != "1234abcd"'
```
-### Session Configurations
-#### Session Inactivity Timeout
+#### Session Configurations
+##### Session Inactivity Timeout
This package sessionizes events based on the periods of inactivity between a user's events on a device. By default, the package will denote a new session once the period between events surpasses **30 minutes**.
To change this timeout value, add the following variable to your `dbt_project.yml` file:
@@ -173,7 +173,7 @@ vars:
sessionization_inactivity: number_of_minutes # ex: 60
```
-#### Session Pass-Through Columns
+##### Session Pass-Through Columns
By default, the `mixpanel__sessions` model will contain the following columns from `mixpanel__event`:
- `people_id`: The ID of the user
- `device_id`: The ID of the device they used in this session
@@ -187,7 +187,7 @@ vars:
session_passthrough_columns: ['the', 'list', 'of', 'column', 'names']
```
-#### Session Event Criteria
+##### Session Event Criteria
In addition to any global event filters, you may want to disclude events or place filters on them in order to qualify for sessionization.
To apply any filters to the events in the sessions model, add the following variable to your `dbt_project.yml` file. It will be applied as a `WHERE` clause when selecting from `mixpanel__event`.
@@ -200,7 +200,7 @@ vars:
session_event_criteria: 'event_type in ("play_song", "stop_song", "create_playlist")'
```
-#### Lookback Window
+##### Lookback Window
Events can sometimes arrive late. For example, events triggered on a mobile device that is offline will be sent to Mixpanel once the device reconnects to wifi or a cell network. Since many of the models in this package are incremental, by default we look back 7 days to ensure late arrivals are captured while avoiding requiring a full refresh. To change the default lookback window, add the following variable to your `dbt_project.yml` file:
```yml
@@ -209,7 +209,7 @@ vars:
lookback_window: number_of_days # default is 7
```
-### Changing the Build Schema
+#### Changing the Build Schema
By default this package will build the Mixpanel staging models within a schema titled ( + `_stg_mixpanel`) and Mixpanel final models within a schema titled ( + `mixpanel`) in your target database. If this is not where you would like your modeled Mixpanel data to be written to, add the following configuration to your `dbt_project.yml` file:
```yml
@@ -220,7 +220,7 @@ models:
+schema: my_new_schema_name # leave blank for just the target_schema
```
-### Change the source table references
+#### Change the source table references
If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_mixpanel/blob/main/dbt_project.yml) variable declarations to see the expected names.
@@ -230,7 +230,7 @@ vars:
mixpanel__identifier: your_table_name
```
-## Event De-Duplication Logic
+### Event De-Duplication Logic
Events are considered duplicates and consolidated by the package if they contain the same:
* `insert_id` (used for de-deuplication internally by Mixpanel)
@@ -240,14 +240,14 @@ Events are considered duplicates and consolidated by the package if they contain
This is performed in line with Mixpanel's internal de-duplication process, in which events are de-duped at the end of each day. This means that if an event was triggered during an offline session at 11:59 PM and _resent_ when the user came online at 12:01 AM, these records would _not_ be de-duplicated. This is the case in both Mixpanel and the Mixpanel dbt package.
-## (Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™
+### (Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™
Expand for details
Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide).
-# 🔍 Does this package have dependencies?
+## 🔍 Does this package have dependencies?
This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site.
> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.
@@ -259,16 +259,16 @@ packages:
- package: dbt-labs/dbt_utils
version: [">=1.0.0", "<2.0.0"]
```
-# 🙌 How is this package maintained and can I contribute?
-## Package Maintenance
+## 🙌 How is this package maintained and can I contribute?
+### Package Maintenance
The Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/mixpanel/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_mixpanel/blob/main/CHANGELOG.md) and release notes for more information on changes across versions.
-## Contributions
+### Contributions
A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions!
We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package!
-# 🏪 Are there any resources available?
+## 🏪 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_mixpanel/issues/new/choose) section to find the right avenue of support for you.
- If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW).
- Have questions or want to just say hi? Book a time during our office hours [on Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com.
diff --git a/dbt_project.yml b/dbt_project.yml
index a80680a..1ae33f9 100644
--- a/dbt_project.yml
+++ b/dbt_project.yml
@@ -1,6 +1,6 @@
config-version: 2
name: 'mixpanel'
-version: '0.9.0'
+version: '0.10.0'
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
mixpanel:
diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml
index f8b1e4e..11a4225 100644
--- a/integration_tests/ci/sample.profiles.yml
+++ b/integration_tests/ci/sample.profiles.yml
@@ -49,6 +49,14 @@ integration_tests:
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
schema: mixpanel_integration_tests_2
- threads: 2
+ threads: 8
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
+ type: databricks
+ databricks-sql:
+ catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
+ host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
+ http_path: "{{ env_var('CI_DATABRICKS_SQL_DBT_HTTP_PATH') }}"
+ schema: mixpanel_sqlw_tests
+ threads: 8
+ token: "{{ env_var('CI_DATABRICKS_SQL_DBT_TOKEN') }}"
type: databricks
\ No newline at end of file
diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml
index b9ca8bb..aece95e 100644
--- a/integration_tests/dbt_project.yml
+++ b/integration_tests/dbt_project.yml
@@ -1,5 +1,5 @@
name: 'mixpanel_integration_tests'
-version: '0.9.0'
+version: '0.10.0'
config-version: 2
profile: 'integration_tests'
vars:
@@ -19,3 +19,8 @@ seeds:
dispatch:
- macro_namespace: dbt_utils
search_order: ['spark_utils', 'dbt_utils']
+
+# Check if the models section already exists!!!
+models:
+ mixpanel:
+ +schema: "{{ 'mixpanel_sqlw_tests' if target.name == 'databricks-sql' else 'mixpanel' }}"
\ No newline at end of file
diff --git a/macros/is_incremental_compatible.sql b/macros/is_incremental_compatible.sql
new file mode 100644
index 0000000..b9ef96c
--- /dev/null
+++ b/macros/is_incremental_compatible.sql
@@ -0,0 +1,17 @@
+{% macro is_incremental_compatible() %}
+ {% if target.type in ('databricks') %}
+ {% set re = modules.re %}
+ {% set path_match = target.http_path %}
+ {% set regex_pattern = "sql/protocol" %}
+ {% set match_result = re.search(regex_pattern, path_match) %}
+ {% if match_result %}
+ {{ return(True) }}
+ {% else %}
+ {{ return(False) }}
+ {% endif %}
+ {% elif target.type in ('bigquery','snowflake','postgres','redshift','sqlserver') %}
+ {{ return(True) }}
+ {% else %}
+ {{ return(False) }}
+ {% endif %}
+{% endmacro %}
diff --git a/models/mixpanel__daily_events.sql b/models/mixpanel__daily_events.sql
index d074b97..99b8a9c 100644
--- a/models/mixpanel__daily_events.sql
+++ b/models/mixpanel__daily_events.sql
@@ -1,6 +1,6 @@
{{
config(
- materialized='incremental',
+ materialized='incremental' if is_incremental_compatible() else 'table',
unique_key='unique_key',
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
partition_by={
@@ -9,7 +9,7 @@
} if target.type not in ('spark','databricks')
else ['date_day'],
cluster_by=['date_day', 'event_type'],
- file_format='parquet'
+ file_format='delta'
)
}}
diff --git a/models/mixpanel__event.sql b/models/mixpanel__event.sql
index 8b0eb01..401520e 100644
--- a/models/mixpanel__event.sql
+++ b/models/mixpanel__event.sql
@@ -1,6 +1,6 @@
{{
config(
- materialized='incremental',
+ materialized='incremental' if is_incremental_compatible() else 'table',
unique_key='unique_event_id',
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
partition_by={
@@ -9,7 +9,7 @@
} if target.type not in ('spark','databricks')
else ['date_day'],
cluster_by=['date_day', 'event_type', 'people_id'],
- file_format='parquet'
+ file_format='delta'
)
}}
diff --git a/models/mixpanel__monthly_events.sql b/models/mixpanel__monthly_events.sql
index 24ebe9b..80c1ccf 100644
--- a/models/mixpanel__monthly_events.sql
+++ b/models/mixpanel__monthly_events.sql
@@ -1,6 +1,6 @@
{{
config(
- materialized='incremental',
+ materialized='incremental' if is_incremental_compatible() else 'table',
unique_key='unique_key',
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
partition_by={
@@ -9,7 +9,7 @@
} if target.type not in ('spark','databricks')
else ['date_month'],
cluster_by=['date_month', 'event_type'],
- file_format='parquet'
+ file_format='delta'
)
}}
diff --git a/models/mixpanel__sessions.sql b/models/mixpanel__sessions.sql
index 7a1592d..b6728d7 100644
--- a/models/mixpanel__sessions.sql
+++ b/models/mixpanel__sessions.sql
@@ -1,6 +1,6 @@
{{
config(
- materialized='incremental',
+ materialized='incremental' if is_incremental_compatible() else 'table',
unique_key='session_id',
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
partition_by={
@@ -9,7 +9,7 @@
} if target.type not in ('spark','databricks')
else ['session_started_on_day'],
cluster_by=['session_started_on_day'],
- file_format='parquet'
+ file_format='delta'
)
}}
diff --git a/models/staging/stg_mixpanel__user_event_date_spine.sql b/models/staging/stg_mixpanel__user_event_date_spine.sql
index 6f8b42b..80ac780 100644
--- a/models/staging/stg_mixpanel__user_event_date_spine.sql
+++ b/models/staging/stg_mixpanel__user_event_date_spine.sql
@@ -1,6 +1,6 @@
{{
config(
- materialized='incremental',
+ materialized='incremental' if is_incremental_compatible() else 'table',
unique_key='unique_key',
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
partition_by={
@@ -9,7 +9,7 @@
} if target.type not in ('spark','databricks')
else ['date_day'],
cluster_by=['date_day', 'event_type', 'people_id'],
- file_format='parquet'
+ file_format='delta'
)
}}
diff --git a/packages.yml b/packages.yml
index 8911cb1..ab625e8 100644
--- a/packages.yml
+++ b/packages.yml
@@ -1,3 +1,7 @@
packages:
- package: fivetran/fivetran_utils
version: [">=0.4.0", "<0.5.0"]
+
+- git: https://github.com/fivetran/dbt_mixpanel_source.git
+ revision: MagicBot/2024-q3-updates
+ warn-unpinned: false
\ No newline at end of file
From 4baf4c4fe2168018e1bb0a11b59c4e54caed2111 Mon Sep 17 00:00:00 2001
From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
Date: Tue, 23 Jul 2024 10:43:56 -0500
Subject: [PATCH 02/12] Update run_models.sh
---
.buildkite/scripts/run_models.sh | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh
index cbc275c..632347b 100644
--- a/.buildkite/scripts/run_models.sh
+++ b/.buildkite/scripts/run_models.sh
@@ -20,23 +20,15 @@ if [ "$db" = "databricks-sql" ]; then
dbt seed --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db" --full-refresh
dbt compile --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db" --full-refresh
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: true}' --target "$db" --full-refresh
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: true}' --target "$db"
+dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__credits_pricing: false, fivetran_platform__usage_pricing: true}' --target "$db" --full-refresh
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__credits_pricing: false, fivetran_platform__usage_pricing: true}' --target "$db"
-dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: false, fivetran_platform_using_destination_membership: false, fivetran_platform_using_user: false}' --target "$db" --full-refresh
-dbt run --vars '{mixpanel_schema: mixpanel_sqlw_tests, fivetran_platform__usage_pricing: false, fivetran_platform_using_destination_membership: false, fivetran_platform_using_user: false}' --target "$db"
-dbt test --vars '{mixpanel_schema: mixpanel_sqlw_tests}' --target "$db"
else
dbt seed --target "$db" --full-refresh
+dbt compile --target "$db"
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --target "$db"
dbt test --target "$db"
+fi
dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
-
-fi
\ No newline at end of file
From 83a958d1411db6fcf5c9542cb838d7753ab6c19c Mon Sep 17 00:00:00 2001
From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
Date: Tue, 23 Jul 2024 17:18:23 -0500
Subject: [PATCH 03/12] update packages
---
packages.yml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/packages.yml b/packages.yml
index ab625e8..c4c9828 100644
--- a/packages.yml
+++ b/packages.yml
@@ -1,7 +1,3 @@
packages:
- package: fivetran/fivetran_utils
- version: [">=0.4.0", "<0.5.0"]
-
-- git: https://github.com/fivetran/dbt_mixpanel_source.git
- revision: MagicBot/2024-q3-updates
- warn-unpinned: false
\ No newline at end of file
+ version: [">=0.4.0", "<0.5.0"]
\ No newline at end of file
From 3b408fe76aa2725e47b6a2560c43f68fe5472b32 Mon Sep 17 00:00:00 2001
From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
Date: Wed, 24 Jul 2024 16:38:45 -0500
Subject: [PATCH 04/12] update changelog & readme
---
CHANGELOG.md | 3 +-
README.md | 68 ++++++++++++++++---------------
integration_tests/dbt_project.yml | 13 +++---
3 files changed, 44 insertions(+), 40 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6b59a33..1085f91 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,11 +8,12 @@
- For Databricks All-Purpose clusters, incremental models will now be materialized using the delta table format (previously parquet).
- Delta tables are generally more performant than parquet and are also more widely available for Databricks users. This will also prevent compilation issues on customers' managed tables.
-- For Databricks SQL Warehouses, incremental materialization will not be used due to the incompatibility of the `insert_overwrite` strategy.
+- For Databricks SQL Warehouses, incremental materialization will not be used due to the incompatibility of the `insert_overwrite` strategy.
## Under the Hood
- The `is_databricks_sql_warehouse` has been added to return `true` if the Databricks runtime being used is an all-purpose cluster **or** if any other Databricks non-supported destination is being used.
- This update was applied as there have been other Databricks runtimes discovered (ie. an endpoint and external runtime) which do not support the `insert_overwrite` incremental strategy used.
+
# dbt_mixpanel v0.9.0
[PR #41](https://github.com/fivetran/dbt_mixpanel/pull/41) includes the following updates:
diff --git a/README.md b/README.md
index 6d8f031..f36d425 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
# Mixpanel dbt Package ([Docs](https://fivetran.github.io/dbt_mixpanel/))
-## 📣 What does this dbt package do?
+# 📣 What does this dbt package do?
- Produces modeled tables that leverage Mixpanel data from [Fivetran's connector](https://fivetran.com/docs/applications/mixpanel). It uses the Mixpanel `event` table in the format described by [this ERD](https://fivetran.com/docs/applications/mixpanel#schemainformation).
@@ -39,15 +39,15 @@ The following table provides a detailed list of all models materialized within t
-## 🎯 How do I use the dbt package?
+# 🎯 How do I use the dbt package?
-### Step 1: Prerequisites
+## Step 1: Prerequisites
To use this dbt package, you must have the following:
- At least one Fivetran Mixpanel connector syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
-#### Databricks dispatch configuration
+### Databricks dispatch configuration
If you are using a Databricks destination with this package, you must add the following (or a variation of the following) dispatch configuration within your `dbt_project.yml`. This is required in order for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively.
```yml
dispatch:
@@ -55,26 +55,26 @@ dispatch:
search_order: ['spark_utils', 'dbt_utils']
```
-#### Database Incremental Strategies
-Many of the end models in this package are materialized incrementally, so we have configured our models to work with the different strategies available to each supported warehouse.
+### Database Incremental Strategies
+Many of the models in this package are materialized incrementally, so we have configured our models to work with the different strategies available to each supported warehouse.
-For **BigQuery** and **Databricks** destinations, we have chosen `insert_overwrite` as the default strategy, which benefits from the partitioning capability.
+For **BigQuery** and **Databricks All Purpose Cluster runtime** destinations, we have chosen `insert_overwrite` as the default strategy, which benefits from the partitioning capability.
+> For Databricks SQL Warehouse destinations, models are materialized as tables without support for incremental runs.
For **Snowflake**, **Redshift**, and **Postgres** databases, we have chosen `delete+insert` as the default strategy.
> Regardless of strategy, we recommend that users periodically run a `--full-refresh` to ensure a high level of data quality.
-
-### Step 2: Install the package
+## Step 2: Install the package
Include the following mixpanel package version in your `packages.yml` file:
> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.
```yaml
packages:
- package: fivetran/mixpanel
- version: [">=0.9.0", "<0.10.0"] # we recommend using ranges to capture non-breaking changes automatically
+ version: [">=0.10.0", "<0.11.0"] # we recommend using ranges to capture non-breaking changes automatically
```
-### Step 3: Define database and schema variables
+## Step 3: Define database and schema variables
By default, this package runs using your destination and the `mixpanel` schema. If this is not where your Mixpanel data is (for example, if your Mixpanel schema is named `mixpanel_fivetran`), add the following configuration to your root `dbt_project.yml` file:
```yml
@@ -83,10 +83,11 @@ vars:
mixpanel_schema: your_schema_name
```
-### (Optional) Step 4: Additional configurations
+## (Optional) Step 4: Additional configurations
+Collapse/expand details
-### Macros
-#### analyze_funnel [(source)](https://github.com/fivetran/dbt_mixpanel/blob/master/macros/analyze_funnel.sql)
+## Macros
+### analyze_funnel [(source)](https://github.com/fivetran/dbt_mixpanel/blob/master/macros/analyze_funnel.sql)
You can use the `analyze_funnel(event_funnel, group_by_column, conversion_criteria)` macro to produce a funnel between a given list of event types.
It returns the following:
@@ -103,7 +104,7 @@ The macro takes the following as arguments:
- `conversion_criteria`: (Optional) A `WHERE` clause that will be applied when selecting from `mixpanel__event`.
- Example: To limit all events in the funnel to the United States, you'd provide `conversion_criteria = 'country_code = "US"'`. To limit the events to only song play events to the US, you'd input `conversion_criteria = 'country_code = "US"' OR event_type != 'play_song'`.
-#### Pivoting Out Event Properties
+### Pivoting Out Event Properties
By default, this package selects the [default columns collected by Mixpanel](https://help.mixpanel.com/hc/en-us/articles/115004613766-What-properties-do-Mixpanel-s-libraries-store-by-default-). However, you likely have custom properties or columns that you'd like to include in the `mixpanel__event` model.
If there are properties in the `mixpanel.event.properties` JSON blob that you'd like to pivot out into columns, add the following variable to your `dbt_project.yml` file:
@@ -114,7 +115,7 @@ vars:
event_properties_to_pivot: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
```
-#### Passthrough Columns
+### Passthrough Columns
Additionally, this package includes all standard source `EVENT` columns defined in the `staging_columns` macro. You can add more columns using our passthrough column variables. These variables allow the passthrough fields to be aliased (`alias`) and casted (`transform_sql`) if desired, although it is not required. Data type casting is configured via a SQL snippet within the `transform_sql` key. You may add the desired SQL snippet while omitting the `as field_name` part of the casting statement - this will be dealt with by the alias attribute - and your custom passthrough fields will be casted accordingly.
Use the following format for declaring the respective passthrough variables:
@@ -129,14 +130,14 @@ vars:
- name: "this_other_field"
transform_sql: "cast(this_other_field as string)"
```
-#### Sessions Event Frequency Limit
+### Sessions Event Frequency Limit
The `event_frequencies` field within the `mixpanel__sessions` model reports all event types and the frequency of those events as a JSON blob via a string aggregation. For some users there can be thousands of different event types that take place. For Redshift and Postgres warehouses there currently exists a limit for string aggregations (up to 65,535). As a result, in order for Redshift and Postgres users to still leverage the `event_frequencies` field, an artificial limit is applied to this field of 1,000. If you would like to adjust this limit, you may do so by modifying the below variable in your project configuration.
```yml
vars:
mixpanel:
mixpanel__event_frequency_limit: 500 ## Default is 1000
```
-#### Event Date Range
+### Event Date Range
Because of the typical volume of event data, you may want to limit this package's models to work with a recent date range of your Mixpanel data (however, note that all final models are materialized as [incremental](https://docs.getdbt.com/docs/building-a-dbt-project/building-models/materializations#incremental) tables).
By default, the package looks at all events since January 1, 2010. To change this start date, add the following variable to your `dbt_project.yml` file:
@@ -149,7 +150,7 @@ vars:
**Note:** This date range will not affect the `number_of_new_users` column in the `mixpanel__daily_events` or `mixpanel__monthly_events` models. This metric will be *true* new users.
-#### Global Event Filters
+### Global Event Filters
In addition to limiting the date range, you may want to employ other filters to remove noise from your event data.
To apply a global filter to events (and therefore **all** models in this package), add the following variable to your `dbt_project.yml` file. It will be applied as a `WHERE` clause when selecting from the source table, `mixpanel.event`.
@@ -161,8 +162,8 @@ vars:
global_event_filter: 'distinct_id != "1234abcd"'
```
-#### Session Configurations
-##### Session Inactivity Timeout
+### Session Configurations
+#### Session Inactivity Timeout
This package sessionizes events based on the periods of inactivity between a user's events on a device. By default, the package will denote a new session once the period between events surpasses **30 minutes**.
To change this timeout value, add the following variable to your `dbt_project.yml` file:
@@ -173,7 +174,7 @@ vars:
sessionization_inactivity: number_of_minutes # ex: 60
```
-##### Session Pass-Through Columns
+#### Session Pass-Through Columns
By default, the `mixpanel__sessions` model will contain the following columns from `mixpanel__event`:
- `people_id`: The ID of the user
- `device_id`: The ID of the device they used in this session
@@ -187,7 +188,7 @@ vars:
session_passthrough_columns: ['the', 'list', 'of', 'column', 'names']
```
-##### Session Event Criteria
+#### Session Event Criteria
In addition to any global event filters, you may want to disclude events or place filters on them in order to qualify for sessionization.
To apply any filters to the events in the sessions model, add the following variable to your `dbt_project.yml` file. It will be applied as a `WHERE` clause when selecting from `mixpanel__event`.
@@ -200,7 +201,7 @@ vars:
session_event_criteria: 'event_type in ("play_song", "stop_song", "create_playlist")'
```
-##### Lookback Window
+#### Lookback Window
Events can sometimes arrive late. For example, events triggered on a mobile device that is offline will be sent to Mixpanel once the device reconnects to wifi or a cell network. Since many of the models in this package are incremental, by default we look back 7 days to ensure late arrivals are captured while avoiding requiring a full refresh. To change the default lookback window, add the following variable to your `dbt_project.yml` file:
```yml
@@ -209,7 +210,7 @@ vars:
lookback_window: number_of_days # default is 7
```
-#### Changing the Build Schema
+### Changing the Build Schema
By default this package will build the Mixpanel staging models within a schema titled ( + `_stg_mixpanel`) and Mixpanel final models within a schema titled ( + `mixpanel`) in your target database. If this is not where you would like your modeled Mixpanel data to be written to, add the following configuration to your `dbt_project.yml` file:
```yml
@@ -220,7 +221,7 @@ models:
+schema: my_new_schema_name # leave blank for just the target_schema
```
-#### Change the source table references
+### Change the source table references
If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_mixpanel/blob/main/dbt_project.yml) variable declarations to see the expected names.
@@ -230,7 +231,7 @@ vars:
mixpanel__identifier: your_table_name
```
-### Event De-Duplication Logic
+## Event De-Duplication Logic
Events are considered duplicates and consolidated by the package if they contain the same:
* `insert_id` (used for de-deuplication internally by Mixpanel)
@@ -239,15 +240,16 @@ Events are considered duplicates and consolidated by the package if they contain
* calendar date of occurrence (event timestamps are set in the timezone the Mixpanel project is configured to)
This is performed in line with Mixpanel's internal de-duplication process, in which events are de-duped at the end of each day. This means that if an event was triggered during an offline session at 11:59 PM and _resent_ when the user came online at 12:01 AM, these records would _not_ be de-duplicated. This is the case in both Mixpanel and the Mixpanel dbt package.
+
-### (Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™
+## (Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™
Expand for details
Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide).
-## 🔍 Does this package have dependencies?
+# 🔍 Does this package have dependencies?
This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site.
> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.
@@ -259,16 +261,16 @@ packages:
- package: dbt-labs/dbt_utils
version: [">=1.0.0", "<2.0.0"]
```
-## 🙌 How is this package maintained and can I contribute?
-### Package Maintenance
+# 🙌 How is this package maintained and can I contribute?
+## Package Maintenance
The Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/mixpanel/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_mixpanel/blob/main/CHANGELOG.md) and release notes for more information on changes across versions.
-### Contributions
+## Contributions
A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions!
We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package!
-## 🏪 Are there any resources available?
+# 🏪 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_mixpanel/issues/new/choose) section to find the right avenue of support for you.
- If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW).
- Have questions or want to just say hi? Book a time during our office hours [on Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com.
diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml
index aece95e..132ec86 100644
--- a/integration_tests/dbt_project.yml
+++ b/integration_tests/dbt_project.yml
@@ -2,10 +2,16 @@ name: 'mixpanel_integration_tests'
version: '0.10.0'
config-version: 2
profile: 'integration_tests'
+
+models:
+ mixpanel:
+ +schema: "{{ 'mixpanel_sqlw_tests' if target.name == 'databricks-sql' else 'mixpanel' }}"
+
vars:
mixpanel_schema: mixpanel_integration_tests_2
mixpanel:
mixpanel_event_identifier: "event"
+
seeds:
mixpanel_integration_tests:
+column_types:
@@ -18,9 +24,4 @@ seeds:
dispatch:
- macro_namespace: dbt_utils
- search_order: ['spark_utils', 'dbt_utils']
-
-# Check if the models section already exists!!!
-models:
- mixpanel:
- +schema: "{{ 'mixpanel_sqlw_tests' if target.name == 'databricks-sql' else 'mixpanel' }}"
\ No newline at end of file
+ search_order: ['spark_utils', 'dbt_utils']
\ No newline at end of file
From 70fae6b833123ad5e4b89dcf37fb07a9aa7f6257 Mon Sep 17 00:00:00 2001
From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
Date: Wed, 24 Jul 2024 17:02:13 -0500
Subject: [PATCH 05/12] Update mixpanel_lookback.sql (#45)
* Update mixpanel_lookback.sql
* update changelog
---
CHANGELOG.md | 1 +
macros/mixpanel_lookback.sql | 31 +++++++------------------------
2 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1085f91..fe6edc2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
## Under the Hood
- The `is_databricks_sql_warehouse` has been added to return `true` if the Databricks runtime being used is an all-purpose cluster **or** if any other Databricks non-supported destination is being used.
- This update was applied as there have been other Databricks runtimes discovered (ie. an endpoint and external runtime) which do not support the `insert_overwrite` incremental strategy used.
+- Updated logic for macro `mixpanel_lookback` to align with logic used in similar macros in other packages.
# dbt_mixpanel v0.9.0
[PR #41](https://github.com/fivetran/dbt_mixpanel/pull/41) includes the following updates:
diff --git a/macros/mixpanel_lookback.sql b/macros/mixpanel_lookback.sql
index 81eeaf0..7f97801 100644
--- a/macros/mixpanel_lookback.sql
+++ b/macros/mixpanel_lookback.sql
@@ -6,30 +6,13 @@
{% macro default__mixpanel_lookback(from_date, datepart, interval, safety_date='2010-01-01') %}
- coalesce(
- (select {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=from_date) }}
- from {{ this }}),
- {{ "'" ~ safety_date ~ "'" }}
- )
+ {% set sql_statement %}
+ select coalesce({{ from_date }}, {{ "'" ~ safety_date ~ "'" }})
+ from {{ this }}
+ {%- endset -%}
-{% endmacro %}
-
-{% macro bigquery__mixpanel_lookback(from_date, datepart, interval, safety_date='2010-01-01') %}
-
- -- Capture the latest timestamp in a call statement instead of a subquery for optimizing BQ costs on incremental runs
- {%- call statement('date_agg', fetch_result=True) -%}
- select {{ from_date }} from {{ this }}
- {%- endcall -%}
+ {%- set result = dbt_utils.get_single_value(sql_statement) %}
- -- load the result from the above query into a new variable
- {%- set query_result = load_result('date_agg') -%}
+ {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp="cast('" ~ result ~ "' as date)") }}
- -- the query_result is stored as a dataframe. Therefore, we want to now store it as a singular value.
- {%- set date_agg = query_result['data'][0][0] %}
-
- coalesce(
- {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp="'" ~ date_agg ~ "'") }},
- {{ "'" ~ safety_date ~ "'" }}
- )
-
-{% endmacro %}
\ No newline at end of file
+{% endmacro %}
From 39769c25c380c40cf387f9a23f7935a5ce8f0df9 Mon Sep 17 00:00:00 2001
From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
Date: Wed, 24 Jul 2024 17:11:22 -0500
Subject: [PATCH 06/12] regen docs
---
docs/catalog.json | 2 +-
docs/index.html | 47 +++++++++----------------------------------
docs/manifest.json | 2 +-
docs/run_results.json | 2 +-
4 files changed, 13 insertions(+), 40 deletions(-)
diff --git a/docs/catalog.json b/docs/catalog.json
index be84d22..36d592f 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.7.7", "generated_at": "2024-02-21T18:28:47.813672Z", "invocation_id": "4d877b6c-31f7-49ea-8565-61f0b8d87c80", "env": {}}, "nodes": {"seed.mixpanel_integration_tests.event": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2", "name": "event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_file": {"type": "text", "index": 1, "name": "_file", "comment": null}, "_line": {"type": "integer", "index": 2, "name": "_line", "comment": null}, "_fivetran_id": {"type": "text", "index": 3, "name": "_fivetran_id", "comment": null}, "event_id": {"type": "integer", "index": 4, "name": "event_id", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "time": {"type": "timestamp without time zone", "index": 6, "name": "time", "comment": null}, "distinct_id": {"type": "character varying(100)", "index": 7, "name": "distinct_id", "comment": null}, "properties": {"type": "text", "index": 8, "name": "properties", "comment": null}, "insert_id": {"type": "text", "index": 9, "name": "insert_id", "comment": null}, "mp_processing_time_ms": {"type": "integer", "index": 10, "name": "mp_processing_time_ms", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 11, "name": "_fivetran_synced", "comment": null}, "screen_width": {"type": "integer", "index": 12, "name": "screen_width", "comment": null}, "wifi": {"type": "integer", "index": 13, "name": "wifi", "comment": null}, "app_release": {"type": "integer", "index": 14, "name": "app_release", "comment": null}, "app_version": {"type": "integer", "index": 15, "name": "app_version", "comment": null}, "os": {"type": "integer", "index": 16, "name": "os", "comment": null}, "mp_device_model": {"type": "integer", "index": 17, "name": "mp_device_model", "comment": null}, "city": {"type": "integer", "index": 18, "name": "city", "comment": null}, "os_version": {"type": "integer", "index": 19, "name": "os_version", "comment": null}, "mp_country_code": {"type": "integer", "index": 20, "name": "mp_country_code", "comment": null}, "lib_version": {"type": "integer", "index": 21, "name": "lib_version", "comment": null}, "manufacturer": {"type": "integer", "index": 22, "name": "manufacturer", "comment": null}, "radio": {"type": "integer", "index": 23, "name": "radio", "comment": null}, "carrier": {"type": "integer", "index": 24, "name": "carrier", "comment": null}, "screen_height": {"type": "integer", "index": 25, "name": "screen_height", "comment": null}, "app_build_number": {"type": "integer", "index": 26, "name": "app_build_number", "comment": null}, "model": {"type": "integer", "index": 27, "name": "model", "comment": null}, "region": {"type": "integer", "index": 28, "name": "region", "comment": null}, "app_version_string": {"type": "integer", "index": 29, "name": "app_version_string", "comment": null}, "mp_lib": {"type": "integer", "index": 30, "name": "mp_lib", "comment": null}, "initial_referring_domain": {"type": "integer", "index": 31, "name": "initial_referring_domain", "comment": null}, "device_id": {"type": "character varying(100)", "index": 32, "name": "device_id", "comment": null}, "referrer": {"type": "integer", "index": 33, "name": "referrer", "comment": null}, "current_url": {"type": "integer", "index": 34, "name": "current_url", "comment": null}, "browser": {"type": "integer", "index": 35, "name": "browser", "comment": null}, "browser_version": {"type": "integer", "index": 36, "name": "browser_version", "comment": null}, "initial_referrer": {"type": "integer", "index": 37, "name": "initial_referrer", "comment": null}, "search_engine": {"type": "integer", "index": 38, "name": "search_engine", "comment": null}, "referring_domain": {"type": "integer", "index": 39, "name": "referring_domain", "comment": null}, "bluetooth_version": {"type": "integer", "index": 40, "name": "bluetooth_version", "comment": null}, "has_nfc": {"type": "integer", "index": 41, "name": "has_nfc", "comment": null}, "brand": {"type": "integer", "index": 42, "name": "brand", "comment": null}, "has_telephone": {"type": "integer", "index": 43, "name": "has_telephone", "comment": null}, "screen_dpi": {"type": "integer", "index": 44, "name": "screen_dpi", "comment": null}, "google_play_services": {"type": "integer", "index": 45, "name": "google_play_services", "comment": null}, "had_persisted_distinct_id": {"type": "integer", "index": 46, "name": "had_persisted_distinct_id", "comment": null}, "bluetooth_enabled": {"type": "integer", "index": 47, "name": "bluetooth_enabled", "comment": null}, "ios_ifa": {"type": "integer", "index": 48, "name": "ios_ifa", "comment": null}, "device": {"type": "integer", "index": 49, "name": "device", "comment": null}, "mp_keyword": {"type": "integer", "index": 50, "name": "mp_keyword", "comment": null}, "distinct_id_before_identity": {"type": "integer", "index": 51, "name": "distinct_id_before_identity", "comment": null}, "ae_session_length": {"type": "integer", "index": 52, "name": "ae_session_length", "comment": null}, "insert_id_": {"type": "integer", "index": 53, "name": "insert_id_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.mixpanel_integration_tests.event"}, "model.mixpanel.mixpanel__daily_events": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2_mixpanel", "name": "mixpanel__daily_events", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "date", "index": 1, "name": "date_day", "comment": null}, "event_type": {"type": "text", "index": 2, "name": "event_type", "comment": null}, "number_of_events": {"type": "numeric", "index": 3, "name": "number_of_events", "comment": null}, "number_of_users": {"type": "bigint", "index": 4, "name": "number_of_users", "comment": null}, "number_of_new_users": {"type": "bigint", "index": 5, "name": "number_of_new_users", "comment": null}, "number_of_repeat_users": {"type": "bigint", "index": 6, "name": "number_of_repeat_users", "comment": null}, "number_of_return_users": {"type": "bigint", "index": 7, "name": "number_of_return_users", "comment": null}, "trailing_users_28d": {"type": "bigint", "index": 8, "name": "trailing_users_28d", "comment": null}, "trailing_users_7d": {"type": "bigint", "index": 9, "name": "trailing_users_7d", "comment": null}, "unique_key": {"type": "text", "index": 10, "name": "unique_key", "comment": null}, "dbt_run_date": {"type": "date", "index": 11, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__daily_events"}, "model.mixpanel.mixpanel__event": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2_mixpanel", "name": "mixpanel__event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"unique_event_id": {"type": "text", "index": 1, "name": "unique_event_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "event_type": {"type": "text", "index": 3, "name": "event_type", "comment": null}, "occurred_at": {"type": "timestamp without time zone", "index": 4, "name": "occurred_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "_fivetran_id": {"type": "text", "index": 6, "name": "_fivetran_id", "comment": null}, "app_session_length": {"type": "integer", "index": 7, "name": "app_session_length", "comment": null}, "app_build_number": {"type": "integer", "index": 8, "name": "app_build_number", "comment": null}, "app_version": {"type": "integer", "index": 9, "name": "app_version", "comment": null}, "has_bluetooth_enabled": {"type": "integer", "index": 10, "name": "has_bluetooth_enabled", "comment": null}, "bluetooth_version": {"type": "integer", "index": 11, "name": "bluetooth_version", "comment": null}, "device_brand": {"type": "integer", "index": 12, "name": "device_brand", "comment": null}, "browser": {"type": "integer", "index": 13, "name": "browser", "comment": null}, "browser_version": {"type": "integer", "index": 14, "name": "browser_version", "comment": null}, "wireless_carrier": {"type": "integer", "index": 15, "name": "wireless_carrier", "comment": null}, "city": {"type": "integer", "index": 16, "name": "city", "comment": null}, "current_url": {"type": "integer", "index": 17, "name": "current_url", "comment": null}, "device_name": {"type": "integer", "index": 18, "name": "device_name", "comment": null}, "device_id": {"type": "character varying(100)", "index": 19, "name": "device_id", "comment": null}, "people_id": {"type": "character varying(100)", "index": 20, "name": "people_id", "comment": null}, "people_id_before_identified": {"type": "integer", "index": 21, "name": "people_id_before_identified", "comment": null}, "google_play_service_status": {"type": "integer", "index": 22, "name": "google_play_service_status", "comment": null}, "has_near_field_communication": {"type": "integer", "index": 23, "name": "has_near_field_communication", "comment": null}, "has_telephone": {"type": "integer", "index": 24, "name": "has_telephone", "comment": null}, "initial_referrer": {"type": "integer", "index": 25, "name": "initial_referrer", "comment": null}, "initial_referring_domain": {"type": "integer", "index": 26, "name": "initial_referring_domain", "comment": null}, "insert_id": {"type": "text", "index": 27, "name": "insert_id", "comment": null}, "mixpanel_library_version": {"type": "integer", "index": 28, "name": "mixpanel_library_version", "comment": null}, "device_manufacturer": {"type": "integer", "index": 29, "name": "device_manufacturer", "comment": null}, "device_model": {"type": "integer", "index": 30, "name": "device_model", "comment": null}, "country_code": {"type": "integer", "index": 31, "name": "country_code", "comment": null}, "referrer_keywords": {"type": "integer", "index": 32, "name": "referrer_keywords", "comment": null}, "mixpanel_library": {"type": "integer", "index": 33, "name": "mixpanel_library", "comment": null}, "mp_processing_time_ms": {"type": "integer", "index": 34, "name": "mp_processing_time_ms", "comment": null}, "event_type_original_casing": {"type": "text", "index": 35, "name": "event_type_original_casing", "comment": null}, "os": {"type": "integer", "index": 36, "name": "os", "comment": null}, "os_version": {"type": "integer", "index": 37, "name": "os_version", "comment": null}, "event_properties": {"type": "text", "index": 38, "name": "event_properties", "comment": null}, "network_type": {"type": "integer", "index": 39, "name": "network_type", "comment": null}, "referrer": {"type": "integer", "index": 40, "name": "referrer", "comment": null}, "referring_domain": {"type": "integer", "index": 41, "name": "referring_domain", "comment": null}, "region": {"type": "integer", "index": 42, "name": "region", "comment": null}, "screen_pixel_density": {"type": "integer", "index": 43, "name": "screen_pixel_density", "comment": null}, "screen_height": {"type": "integer", "index": 44, "name": "screen_height", "comment": null}, "screen_width": {"type": "integer", "index": 45, "name": "screen_width", "comment": null}, "search_engine": {"type": "integer", "index": 46, "name": "search_engine", "comment": null}, "has_wifi_connected": {"type": "integer", "index": 47, "name": "has_wifi_connected", "comment": null}, "nth_event_record": {"type": "bigint", "index": 48, "name": "nth_event_record", "comment": null}, "dbt_run_date": {"type": "date", "index": 49, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__event"}, "model.mixpanel.mixpanel__monthly_events": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2_mixpanel", "name": "mixpanel__monthly_events", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_month": {"type": "date", "index": 1, "name": "date_month", "comment": null}, "event_type": {"type": "text", "index": 2, "name": "event_type", "comment": null}, "total_monthly_active_users": {"type": "bigint", "index": 3, "name": "total_monthly_active_users", "comment": null}, "number_of_users": {"type": "bigint", "index": 4, "name": "number_of_users", "comment": null}, "number_of_new_users": {"type": "bigint", "index": 5, "name": "number_of_new_users", "comment": null}, "number_of_repeat_users": {"type": "bigint", "index": 6, "name": "number_of_repeat_users", "comment": null}, "number_of_return_users": {"type": "bigint", "index": 7, "name": "number_of_return_users", "comment": null}, "number_of_events": {"type": "numeric", "index": 8, "name": "number_of_events", "comment": null}, "number_of_churn_users": {"type": "bigint", "index": 9, "name": "number_of_churn_users", "comment": null}, "unique_key": {"type": "text", "index": 10, "name": "unique_key", "comment": null}, "dbt_run_date": {"type": "date", "index": 11, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__monthly_events"}, "model.mixpanel.mixpanel__sessions": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2_mixpanel", "name": "mixpanel__sessions", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"session_id": {"type": "text", "index": 1, "name": "session_id", "comment": null}, "people_id": {"type": "character varying(100)", "index": 2, "name": "people_id", "comment": null}, "session_started_at": {"type": "timestamp without time zone", "index": 3, "name": "session_started_at", "comment": null}, "session_started_on_day": {"type": "date", "index": 4, "name": "session_started_on_day", "comment": null}, "user_id": {"type": "character varying(100)", "index": 5, "name": "user_id", "comment": null}, "device_id": {"type": "character varying(100)", "index": 6, "name": "device_id", "comment": null}, "total_number_of_events": {"type": "bigint", "index": 7, "name": "total_number_of_events", "comment": null}, "event_frequencies": {"type": "text", "index": 8, "name": "event_frequencies", "comment": null}, "dbt_run_date": {"type": "date", "index": 9, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__sessions"}, "model.mixpanel.stg_mixpanel__user_event_date_spine": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2_stg_mixpanel", "name": "stg_mixpanel__user_event_date_spine", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "date", "index": 1, "name": "date_day", "comment": null}, "people_id": {"type": "character varying(100)", "index": 2, "name": "people_id", "comment": null}, "event_type": {"type": "text", "index": 3, "name": "event_type", "comment": null}, "is_first_event_day": {"type": "integer", "index": 4, "name": "is_first_event_day", "comment": null}, "unique_key": {"type": "text", "index": 5, "name": "unique_key", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.stg_mixpanel__user_event_date_spine"}, "model.mixpanel.stg_mixpanel__user_first_event": {"metadata": {"type": "VIEW", "schema": "22_mixpanel_integration_tests_2_stg_mixpanel", "name": "stg_mixpanel__user_first_event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"people_id": {"type": "character varying(100)", "index": 1, "name": "people_id", "comment": null}, "event_type": {"type": "text", "index": 2, "name": "event_type", "comment": null}, "first_event_day": {"type": "date", "index": 3, "name": "first_event_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.stg_mixpanel__user_first_event"}}, "sources": {"source.mixpanel.mixpanel.event": {"metadata": {"type": "BASE TABLE", "schema": "22_mixpanel_integration_tests_2", "name": "event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_file": {"type": "text", "index": 1, "name": "_file", "comment": null}, "_line": {"type": "integer", "index": 2, "name": "_line", "comment": null}, "_fivetran_id": {"type": "text", "index": 3, "name": "_fivetran_id", "comment": null}, "event_id": {"type": "integer", "index": 4, "name": "event_id", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "time": {"type": "timestamp without time zone", "index": 6, "name": "time", "comment": null}, "distinct_id": {"type": "character varying(100)", "index": 7, "name": "distinct_id", "comment": null}, "properties": {"type": "text", "index": 8, "name": "properties", "comment": null}, "insert_id": {"type": "text", "index": 9, "name": "insert_id", "comment": null}, "mp_processing_time_ms": {"type": "integer", "index": 10, "name": "mp_processing_time_ms", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 11, "name": "_fivetran_synced", "comment": null}, "screen_width": {"type": "integer", "index": 12, "name": "screen_width", "comment": null}, "wifi": {"type": "integer", "index": 13, "name": "wifi", "comment": null}, "app_release": {"type": "integer", "index": 14, "name": "app_release", "comment": null}, "app_version": {"type": "integer", "index": 15, "name": "app_version", "comment": null}, "os": {"type": "integer", "index": 16, "name": "os", "comment": null}, "mp_device_model": {"type": "integer", "index": 17, "name": "mp_device_model", "comment": null}, "city": {"type": "integer", "index": 18, "name": "city", "comment": null}, "os_version": {"type": "integer", "index": 19, "name": "os_version", "comment": null}, "mp_country_code": {"type": "integer", "index": 20, "name": "mp_country_code", "comment": null}, "lib_version": {"type": "integer", "index": 21, "name": "lib_version", "comment": null}, "manufacturer": {"type": "integer", "index": 22, "name": "manufacturer", "comment": null}, "radio": {"type": "integer", "index": 23, "name": "radio", "comment": null}, "carrier": {"type": "integer", "index": 24, "name": "carrier", "comment": null}, "screen_height": {"type": "integer", "index": 25, "name": "screen_height", "comment": null}, "app_build_number": {"type": "integer", "index": 26, "name": "app_build_number", "comment": null}, "model": {"type": "integer", "index": 27, "name": "model", "comment": null}, "region": {"type": "integer", "index": 28, "name": "region", "comment": null}, "app_version_string": {"type": "integer", "index": 29, "name": "app_version_string", "comment": null}, "mp_lib": {"type": "integer", "index": 30, "name": "mp_lib", "comment": null}, "initial_referring_domain": {"type": "integer", "index": 31, "name": "initial_referring_domain", "comment": null}, "device_id": {"type": "character varying(100)", "index": 32, "name": "device_id", "comment": null}, "referrer": {"type": "integer", "index": 33, "name": "referrer", "comment": null}, "current_url": {"type": "integer", "index": 34, "name": "current_url", "comment": null}, "browser": {"type": "integer", "index": 35, "name": "browser", "comment": null}, "browser_version": {"type": "integer", "index": 36, "name": "browser_version", "comment": null}, "initial_referrer": {"type": "integer", "index": 37, "name": "initial_referrer", "comment": null}, "search_engine": {"type": "integer", "index": 38, "name": "search_engine", "comment": null}, "referring_domain": {"type": "integer", "index": 39, "name": "referring_domain", "comment": null}, "bluetooth_version": {"type": "integer", "index": 40, "name": "bluetooth_version", "comment": null}, "has_nfc": {"type": "integer", "index": 41, "name": "has_nfc", "comment": null}, "brand": {"type": "integer", "index": 42, "name": "brand", "comment": null}, "has_telephone": {"type": "integer", "index": 43, "name": "has_telephone", "comment": null}, "screen_dpi": {"type": "integer", "index": 44, "name": "screen_dpi", "comment": null}, "google_play_services": {"type": "integer", "index": 45, "name": "google_play_services", "comment": null}, "had_persisted_distinct_id": {"type": "integer", "index": 46, "name": "had_persisted_distinct_id", "comment": null}, "bluetooth_enabled": {"type": "integer", "index": 47, "name": "bluetooth_enabled", "comment": null}, "ios_ifa": {"type": "integer", "index": 48, "name": "ios_ifa", "comment": null}, "device": {"type": "integer", "index": 49, "name": "device", "comment": null}, "mp_keyword": {"type": "integer", "index": 50, "name": "mp_keyword", "comment": null}, "distinct_id_before_identity": {"type": "integer", "index": 51, "name": "distinct_id_before_identity", "comment": null}, "ae_session_length": {"type": "integer", "index": 52, "name": "ae_session_length", "comment": null}, "insert_id_": {"type": "integer", "index": 53, "name": "insert_id_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mixpanel.mixpanel.event"}}, "errors": null}
\ No newline at end of file
+{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.8.3", "generated_at": "2024-07-24T22:08:57.246853Z", "invocation_id": "beb65af7-b5a2-4479-a00a-73530534394d", "env": {}}, "nodes": {"seed.mixpanel_integration_tests.event": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel", "name": "event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_file": {"type": "text", "index": 1, "name": "_file", "comment": null}, "_line": {"type": "integer", "index": 2, "name": "_line", "comment": null}, "_fivetran_id": {"type": "text", "index": 3, "name": "_fivetran_id", "comment": null}, "event_id": {"type": "integer", "index": 4, "name": "event_id", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "time": {"type": "timestamp without time zone", "index": 6, "name": "time", "comment": null}, "distinct_id": {"type": "character varying(100)", "index": 7, "name": "distinct_id", "comment": null}, "properties": {"type": "text", "index": 8, "name": "properties", "comment": null}, "insert_id": {"type": "text", "index": 9, "name": "insert_id", "comment": null}, "mp_processing_time_ms": {"type": "integer", "index": 10, "name": "mp_processing_time_ms", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 11, "name": "_fivetran_synced", "comment": null}, "screen_width": {"type": "integer", "index": 12, "name": "screen_width", "comment": null}, "wifi": {"type": "integer", "index": 13, "name": "wifi", "comment": null}, "app_release": {"type": "integer", "index": 14, "name": "app_release", "comment": null}, "app_version": {"type": "integer", "index": 15, "name": "app_version", "comment": null}, "os": {"type": "integer", "index": 16, "name": "os", "comment": null}, "mp_device_model": {"type": "integer", "index": 17, "name": "mp_device_model", "comment": null}, "city": {"type": "integer", "index": 18, "name": "city", "comment": null}, "os_version": {"type": "integer", "index": 19, "name": "os_version", "comment": null}, "mp_country_code": {"type": "integer", "index": 20, "name": "mp_country_code", "comment": null}, "lib_version": {"type": "integer", "index": 21, "name": "lib_version", "comment": null}, "manufacturer": {"type": "integer", "index": 22, "name": "manufacturer", "comment": null}, "radio": {"type": "integer", "index": 23, "name": "radio", "comment": null}, "carrier": {"type": "integer", "index": 24, "name": "carrier", "comment": null}, "screen_height": {"type": "integer", "index": 25, "name": "screen_height", "comment": null}, "app_build_number": {"type": "integer", "index": 26, "name": "app_build_number", "comment": null}, "model": {"type": "integer", "index": 27, "name": "model", "comment": null}, "region": {"type": "integer", "index": 28, "name": "region", "comment": null}, "app_version_string": {"type": "integer", "index": 29, "name": "app_version_string", "comment": null}, "mp_lib": {"type": "integer", "index": 30, "name": "mp_lib", "comment": null}, "initial_referring_domain": {"type": "integer", "index": 31, "name": "initial_referring_domain", "comment": null}, "device_id": {"type": "character varying(100)", "index": 32, "name": "device_id", "comment": null}, "referrer": {"type": "integer", "index": 33, "name": "referrer", "comment": null}, "current_url": {"type": "integer", "index": 34, "name": "current_url", "comment": null}, "browser": {"type": "integer", "index": 35, "name": "browser", "comment": null}, "browser_version": {"type": "integer", "index": 36, "name": "browser_version", "comment": null}, "initial_referrer": {"type": "integer", "index": 37, "name": "initial_referrer", "comment": null}, "search_engine": {"type": "integer", "index": 38, "name": "search_engine", "comment": null}, "referring_domain": {"type": "integer", "index": 39, "name": "referring_domain", "comment": null}, "bluetooth_version": {"type": "integer", "index": 40, "name": "bluetooth_version", "comment": null}, "has_nfc": {"type": "integer", "index": 41, "name": "has_nfc", "comment": null}, "brand": {"type": "integer", "index": 42, "name": "brand", "comment": null}, "has_telephone": {"type": "integer", "index": 43, "name": "has_telephone", "comment": null}, "screen_dpi": {"type": "integer", "index": 44, "name": "screen_dpi", "comment": null}, "google_play_services": {"type": "integer", "index": 45, "name": "google_play_services", "comment": null}, "had_persisted_distinct_id": {"type": "integer", "index": 46, "name": "had_persisted_distinct_id", "comment": null}, "bluetooth_enabled": {"type": "integer", "index": 47, "name": "bluetooth_enabled", "comment": null}, "ios_ifa": {"type": "integer", "index": 48, "name": "ios_ifa", "comment": null}, "device": {"type": "integer", "index": 49, "name": "device", "comment": null}, "mp_keyword": {"type": "integer", "index": 50, "name": "mp_keyword", "comment": null}, "distinct_id_before_identity": {"type": "integer", "index": 51, "name": "distinct_id_before_identity", "comment": null}, "ae_session_length": {"type": "integer", "index": 52, "name": "ae_session_length", "comment": null}, "insert_id_": {"type": "integer", "index": 53, "name": "insert_id_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.mixpanel_integration_tests.event"}, "model.mixpanel.mixpanel__daily_events": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel_mixpanel", "name": "mixpanel__daily_events", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "date", "index": 1, "name": "date_day", "comment": null}, "event_type": {"type": "text", "index": 2, "name": "event_type", "comment": null}, "number_of_events": {"type": "numeric", "index": 3, "name": "number_of_events", "comment": null}, "number_of_users": {"type": "bigint", "index": 4, "name": "number_of_users", "comment": null}, "number_of_new_users": {"type": "bigint", "index": 5, "name": "number_of_new_users", "comment": null}, "number_of_repeat_users": {"type": "bigint", "index": 6, "name": "number_of_repeat_users", "comment": null}, "number_of_return_users": {"type": "bigint", "index": 7, "name": "number_of_return_users", "comment": null}, "trailing_users_28d": {"type": "bigint", "index": 8, "name": "trailing_users_28d", "comment": null}, "trailing_users_7d": {"type": "bigint", "index": 9, "name": "trailing_users_7d", "comment": null}, "unique_key": {"type": "text", "index": 10, "name": "unique_key", "comment": null}, "dbt_run_date": {"type": "date", "index": 11, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__daily_events"}, "model.mixpanel.mixpanel__event": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel_mixpanel", "name": "mixpanel__event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"unique_event_id": {"type": "text", "index": 1, "name": "unique_event_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "event_type": {"type": "text", "index": 3, "name": "event_type", "comment": null}, "occurred_at": {"type": "timestamp without time zone", "index": 4, "name": "occurred_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "_fivetran_id": {"type": "text", "index": 6, "name": "_fivetran_id", "comment": null}, "app_session_length": {"type": "integer", "index": 7, "name": "app_session_length", "comment": null}, "app_build_number": {"type": "integer", "index": 8, "name": "app_build_number", "comment": null}, "app_version": {"type": "integer", "index": 9, "name": "app_version", "comment": null}, "has_bluetooth_enabled": {"type": "integer", "index": 10, "name": "has_bluetooth_enabled", "comment": null}, "bluetooth_version": {"type": "integer", "index": 11, "name": "bluetooth_version", "comment": null}, "device_brand": {"type": "integer", "index": 12, "name": "device_brand", "comment": null}, "browser": {"type": "integer", "index": 13, "name": "browser", "comment": null}, "browser_version": {"type": "integer", "index": 14, "name": "browser_version", "comment": null}, "wireless_carrier": {"type": "integer", "index": 15, "name": "wireless_carrier", "comment": null}, "city": {"type": "integer", "index": 16, "name": "city", "comment": null}, "current_url": {"type": "integer", "index": 17, "name": "current_url", "comment": null}, "device_name": {"type": "integer", "index": 18, "name": "device_name", "comment": null}, "device_id": {"type": "character varying(100)", "index": 19, "name": "device_id", "comment": null}, "people_id": {"type": "character varying(100)", "index": 20, "name": "people_id", "comment": null}, "people_id_before_identified": {"type": "integer", "index": 21, "name": "people_id_before_identified", "comment": null}, "google_play_service_status": {"type": "integer", "index": 22, "name": "google_play_service_status", "comment": null}, "has_near_field_communication": {"type": "integer", "index": 23, "name": "has_near_field_communication", "comment": null}, "has_telephone": {"type": "integer", "index": 24, "name": "has_telephone", "comment": null}, "initial_referrer": {"type": "integer", "index": 25, "name": "initial_referrer", "comment": null}, "initial_referring_domain": {"type": "integer", "index": 26, "name": "initial_referring_domain", "comment": null}, "insert_id": {"type": "text", "index": 27, "name": "insert_id", "comment": null}, "mixpanel_library_version": {"type": "integer", "index": 28, "name": "mixpanel_library_version", "comment": null}, "device_manufacturer": {"type": "integer", "index": 29, "name": "device_manufacturer", "comment": null}, "device_model": {"type": "integer", "index": 30, "name": "device_model", "comment": null}, "country_code": {"type": "integer", "index": 31, "name": "country_code", "comment": null}, "referrer_keywords": {"type": "integer", "index": 32, "name": "referrer_keywords", "comment": null}, "mixpanel_library": {"type": "integer", "index": 33, "name": "mixpanel_library", "comment": null}, "mp_processing_time_ms": {"type": "integer", "index": 34, "name": "mp_processing_time_ms", "comment": null}, "event_type_original_casing": {"type": "text", "index": 35, "name": "event_type_original_casing", "comment": null}, "os": {"type": "integer", "index": 36, "name": "os", "comment": null}, "os_version": {"type": "integer", "index": 37, "name": "os_version", "comment": null}, "event_properties": {"type": "text", "index": 38, "name": "event_properties", "comment": null}, "network_type": {"type": "integer", "index": 39, "name": "network_type", "comment": null}, "referrer": {"type": "integer", "index": 40, "name": "referrer", "comment": null}, "referring_domain": {"type": "integer", "index": 41, "name": "referring_domain", "comment": null}, "region": {"type": "integer", "index": 42, "name": "region", "comment": null}, "screen_pixel_density": {"type": "integer", "index": 43, "name": "screen_pixel_density", "comment": null}, "screen_height": {"type": "integer", "index": 44, "name": "screen_height", "comment": null}, "screen_width": {"type": "integer", "index": 45, "name": "screen_width", "comment": null}, "search_engine": {"type": "integer", "index": 46, "name": "search_engine", "comment": null}, "has_wifi_connected": {"type": "integer", "index": 47, "name": "has_wifi_connected", "comment": null}, "nth_event_record": {"type": "bigint", "index": 48, "name": "nth_event_record", "comment": null}, "dbt_run_date": {"type": "date", "index": 49, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__event"}, "model.mixpanel.mixpanel__monthly_events": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel_mixpanel", "name": "mixpanel__monthly_events", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_month": {"type": "date", "index": 1, "name": "date_month", "comment": null}, "event_type": {"type": "text", "index": 2, "name": "event_type", "comment": null}, "total_monthly_active_users": {"type": "bigint", "index": 3, "name": "total_monthly_active_users", "comment": null}, "number_of_users": {"type": "bigint", "index": 4, "name": "number_of_users", "comment": null}, "number_of_new_users": {"type": "bigint", "index": 5, "name": "number_of_new_users", "comment": null}, "number_of_repeat_users": {"type": "bigint", "index": 6, "name": "number_of_repeat_users", "comment": null}, "number_of_return_users": {"type": "bigint", "index": 7, "name": "number_of_return_users", "comment": null}, "number_of_events": {"type": "numeric", "index": 8, "name": "number_of_events", "comment": null}, "number_of_churn_users": {"type": "bigint", "index": 9, "name": "number_of_churn_users", "comment": null}, "unique_key": {"type": "text", "index": 10, "name": "unique_key", "comment": null}, "dbt_run_date": {"type": "date", "index": 11, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__monthly_events"}, "model.mixpanel.mixpanel__sessions": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel_mixpanel", "name": "mixpanel__sessions", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"session_id": {"type": "text", "index": 1, "name": "session_id", "comment": null}, "people_id": {"type": "character varying(100)", "index": 2, "name": "people_id", "comment": null}, "session_started_at": {"type": "timestamp without time zone", "index": 3, "name": "session_started_at", "comment": null}, "session_started_on_day": {"type": "date", "index": 4, "name": "session_started_on_day", "comment": null}, "user_id": {"type": "character varying(100)", "index": 5, "name": "user_id", "comment": null}, "device_id": {"type": "character varying(100)", "index": 6, "name": "device_id", "comment": null}, "total_number_of_events": {"type": "bigint", "index": 7, "name": "total_number_of_events", "comment": null}, "event_frequencies": {"type": "text", "index": 8, "name": "event_frequencies", "comment": null}, "dbt_run_date": {"type": "date", "index": 9, "name": "dbt_run_date", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.mixpanel__sessions"}, "model.mixpanel.stg_mixpanel__user_event_date_spine": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel_mixpanel", "name": "stg_mixpanel__user_event_date_spine", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "date", "index": 1, "name": "date_day", "comment": null}, "people_id": {"type": "character varying(100)", "index": 2, "name": "people_id", "comment": null}, "event_type": {"type": "text", "index": 3, "name": "event_type", "comment": null}, "is_first_event_day": {"type": "integer", "index": 4, "name": "is_first_event_day", "comment": null}, "unique_key": {"type": "text", "index": 5, "name": "unique_key", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.stg_mixpanel__user_event_date_spine"}, "model.mixpanel.stg_mixpanel__user_first_event": {"metadata": {"type": "VIEW", "schema": "zz_mixpanel_mixpanel", "name": "stg_mixpanel__user_first_event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"people_id": {"type": "character varying(100)", "index": 1, "name": "people_id", "comment": null}, "event_type": {"type": "text", "index": 2, "name": "event_type", "comment": null}, "first_event_day": {"type": "date", "index": 3, "name": "first_event_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.mixpanel.stg_mixpanel__user_first_event"}}, "sources": {"source.mixpanel.mixpanel.event": {"metadata": {"type": "BASE TABLE", "schema": "zz_mixpanel", "name": "event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_file": {"type": "text", "index": 1, "name": "_file", "comment": null}, "_line": {"type": "integer", "index": 2, "name": "_line", "comment": null}, "_fivetran_id": {"type": "text", "index": 3, "name": "_fivetran_id", "comment": null}, "event_id": {"type": "integer", "index": 4, "name": "event_id", "comment": null}, "name": {"type": "text", "index": 5, "name": "name", "comment": null}, "time": {"type": "timestamp without time zone", "index": 6, "name": "time", "comment": null}, "distinct_id": {"type": "character varying(100)", "index": 7, "name": "distinct_id", "comment": null}, "properties": {"type": "text", "index": 8, "name": "properties", "comment": null}, "insert_id": {"type": "text", "index": 9, "name": "insert_id", "comment": null}, "mp_processing_time_ms": {"type": "integer", "index": 10, "name": "mp_processing_time_ms", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 11, "name": "_fivetran_synced", "comment": null}, "screen_width": {"type": "integer", "index": 12, "name": "screen_width", "comment": null}, "wifi": {"type": "integer", "index": 13, "name": "wifi", "comment": null}, "app_release": {"type": "integer", "index": 14, "name": "app_release", "comment": null}, "app_version": {"type": "integer", "index": 15, "name": "app_version", "comment": null}, "os": {"type": "integer", "index": 16, "name": "os", "comment": null}, "mp_device_model": {"type": "integer", "index": 17, "name": "mp_device_model", "comment": null}, "city": {"type": "integer", "index": 18, "name": "city", "comment": null}, "os_version": {"type": "integer", "index": 19, "name": "os_version", "comment": null}, "mp_country_code": {"type": "integer", "index": 20, "name": "mp_country_code", "comment": null}, "lib_version": {"type": "integer", "index": 21, "name": "lib_version", "comment": null}, "manufacturer": {"type": "integer", "index": 22, "name": "manufacturer", "comment": null}, "radio": {"type": "integer", "index": 23, "name": "radio", "comment": null}, "carrier": {"type": "integer", "index": 24, "name": "carrier", "comment": null}, "screen_height": {"type": "integer", "index": 25, "name": "screen_height", "comment": null}, "app_build_number": {"type": "integer", "index": 26, "name": "app_build_number", "comment": null}, "model": {"type": "integer", "index": 27, "name": "model", "comment": null}, "region": {"type": "integer", "index": 28, "name": "region", "comment": null}, "app_version_string": {"type": "integer", "index": 29, "name": "app_version_string", "comment": null}, "mp_lib": {"type": "integer", "index": 30, "name": "mp_lib", "comment": null}, "initial_referring_domain": {"type": "integer", "index": 31, "name": "initial_referring_domain", "comment": null}, "device_id": {"type": "character varying(100)", "index": 32, "name": "device_id", "comment": null}, "referrer": {"type": "integer", "index": 33, "name": "referrer", "comment": null}, "current_url": {"type": "integer", "index": 34, "name": "current_url", "comment": null}, "browser": {"type": "integer", "index": 35, "name": "browser", "comment": null}, "browser_version": {"type": "integer", "index": 36, "name": "browser_version", "comment": null}, "initial_referrer": {"type": "integer", "index": 37, "name": "initial_referrer", "comment": null}, "search_engine": {"type": "integer", "index": 38, "name": "search_engine", "comment": null}, "referring_domain": {"type": "integer", "index": 39, "name": "referring_domain", "comment": null}, "bluetooth_version": {"type": "integer", "index": 40, "name": "bluetooth_version", "comment": null}, "has_nfc": {"type": "integer", "index": 41, "name": "has_nfc", "comment": null}, "brand": {"type": "integer", "index": 42, "name": "brand", "comment": null}, "has_telephone": {"type": "integer", "index": 43, "name": "has_telephone", "comment": null}, "screen_dpi": {"type": "integer", "index": 44, "name": "screen_dpi", "comment": null}, "google_play_services": {"type": "integer", "index": 45, "name": "google_play_services", "comment": null}, "had_persisted_distinct_id": {"type": "integer", "index": 46, "name": "had_persisted_distinct_id", "comment": null}, "bluetooth_enabled": {"type": "integer", "index": 47, "name": "bluetooth_enabled", "comment": null}, "ios_ifa": {"type": "integer", "index": 48, "name": "ios_ifa", "comment": null}, "device": {"type": "integer", "index": 49, "name": "device", "comment": null}, "mp_keyword": {"type": "integer", "index": 50, "name": "mp_keyword", "comment": null}, "distinct_id_before_identity": {"type": "integer", "index": 51, "name": "distinct_id_before_identity", "comment": null}, "ae_session_length": {"type": "integer", "index": 52, "name": "ae_session_length", "comment": null}, "insert_id_": {"type": "integer", "index": 53, "name": "insert_id_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.mixpanel.mixpanel.event"}}, "errors": null}
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index ca1e6f8..c580ce9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,30 +1,4 @@
-
-
-
-
-
-
- dbt Docs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,n){n(8).module("dbt").factory("locationService",["$state",function(e){var t={};return t.parseState=function(e){return function(e){return{selected:{include:e.g_i||"",exclude:e.g_e||""},show_graph:!!e.g_v}}(e)},t.setState=function(t){var n=function(e){var t={g_v:1};return t.g_i=e.include,t.g_e=e.exclude,t}(t),r=e.current.name;e.go(r,n)},t.clearState=function(){var t=e.current.name;e.go(t,{g_i:null,g_e:null,g_v:null})},t}])},function(e,t,n){"use strict";const r=n(8),i=n(202);r.module("dbt").controller("OverviewCtrl",["$scope","$state","project",function(e,t,n){e.overview_md="(loading)",n.ready((function(n){let r=t.params.project_name?t.params.project_name:null;var o=n.docs["doc.dbt.__overview__"],a=i.filter(n.docs,{name:"__overview__"});if(i.each(a,(function(e){"dbt"!=e.package_name&&(o=e)})),null!==r){o=n.docs[`doc.${r}.__${r}__`]||o;let e=i.filter(n.docs,{name:`__${r}__`});i.each(e,e=>{e.package_name!==r&&(o=e)})}e.overview_md=o.block_contents}))}])},function(e,t,n){"use strict";n(8).module("dbt").controller("SourceListCtrl",["$scope","$state","project",function(e,t,n){e.source=t.params.source,e.model={},e.extra_table_fields=[],e.has_more_info=function(e){return(e.description||"").length},e.toggle_source_expanded=function(t){e.has_more_info(t)&&(t.expanded=!t.expanded)},n.ready((function(t){var n=_.filter(t.nodes,(function(t){return t.source_name==e.source}));if(0!=n.length){n.sort((e,t)=>e.name.localeCompare(t.name));var r=n[0];e.model={name:e.source,source_description:r.source_description,sources:n};var i=_.uniq(_.map(n,"metadata.owner")),o=_.uniq(_.map(n,"database")),a=_.uniq(_.map(n,"schema"));e.extra_table_fields=[{name:"Loader",value:r.loader},{name:1==i.length?"Owner":"Owners",value:i.join(", ")},{name:1==o.length?"Database":"Databases",value:o.join(", ")},{name:1==a.length?"Schema":"Schemas",value:a.join(", ")},{name:"Tables",value:n.length}]}}))}])},function(e,t,n){const r=n(8),i={main:n(483),overview:n(484),graph:n(485),source:n(205),source_list:n(486),model:n(487),source:n(205),snapshot:n(488),seed:n(489),unit_test:n(490),test:n(491),analysis:n(492),macro:n(493),exposure:n(494),metric:n(495),semantic_model:n(496),saved_query:n(497),operation:n(498)};r.module("dbt").config(["$stateProvider","$urlRouterProvider",function(e,t){var n="g_v&g_i&g_e&g_p&g_n";t.otherwise("/overview"),e.state("dbt",{url:"/",abstract:!0,controller:"MainController",templateUrl:i.main}).state("dbt.overview",{url:"overview?"+n,controller:"OverviewCtrl",templateUrl:i.overview}).state("dbt.project_overview",{url:"overview/:project_name?"+n,controller:"OverviewCtrl",templateUrl:i.overview,params:{project_name:{type:"string"}}}).state("dbt.graph",{url:"graph",controller:"GraphCtrl",templateUrl:i.graph}).state("dbt.model",{url:"model/:unique_id?section&"+n,controller:"ModelCtrl",templateUrl:i.model,params:{unique_id:{type:"string"}}}).state("dbt.seed",{url:"seed/:unique_id?section&"+n,controller:"SeedCtrl",templateUrl:i.seed,params:{unique_id:{type:"string"}}}).state("dbt.snapshot",{url:"snapshot/:unique_id?section&"+n,controller:"SnapshotCtrl",templateUrl:i.snapshot,params:{unique_id:{type:"string"}}}).state("dbt.unit_test",{url:"unit_test/:unique_id?section&"+n,controller:"TestCtrl",templateUrl:i.unit_test,params:{unique_id:{type:"string"}}}).state("dbt.test",{url:"test/:unique_id?section&"+n,controller:"TestCtrl",templateUrl:i.test,params:{unique_id:{type:"string"}}}).state("dbt.analysis",{url:"analysis/:unique_id?section&"+n,controller:"AnalysisCtrl",templateUrl:i.analysis,params:{unique_id:{type:"string"}}}).state("dbt.source",{url:"source/:unique_id?section&"+n,controller:"SourceCtrl",templateUrl:i.source,params:{unique_id:{type:"string"}}}).state("dbt.source_list",{url:"source_list/:source?section&"+n,controller:"SourceListCtrl",templateUrl:i.source_list,params:{source:{type:"string"}}}).state("dbt.macro",{url:"macro/:unique_id?section",controller:"MacroCtrl",templateUrl:i.macro,params:{unique_id:{type:"string"}}}).state("dbt.exposure",{url:"exposure/:unique_id?section&"+n,controller:"ExposureCtrl",templateUrl:i.exposure,params:{unique_id:{type:"string"}}}).state("dbt.metric",{url:"metric/:unique_id?section&"+n,controller:"MetricCtrl",templateUrl:i.metric,params:{unique_id:{type:"string"}}}).state("dbt.semantic_model",{url:"semantic_model/:unique_id?section&"+n,controller:"SemanticModelCtrl",templateUrl:i.semantic_model,params:{unique_id:{type:"string"}}}).state("dbt.saved_query",{url:"saved_query/:unique_id?section&"+n,controller:"SavedQueryCtrl",templateUrl:i.saved_query,params:{unique_id:{type:"string"}}}).state("dbt.operation",{url:"operation/:unique_id?section&"+n,controller:"OperationCtrl",templateUrl:i.operation,params:{unique_id:{type:"string"}}})}])},function(e,t){var n="/main/main.html";window.angular.module("ng").run(["$templateCache",function(e){e.put(n,'\n\n