diff --git a/CHANGELOG.md b/CHANGELOG.md index a8373db..72b63a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# dbt_shopify_holistic_reporting v0.1.1 +## Bug Fixes +Incorporate the try_cast macro from fivetran_utils to ensure that the numeric_value field in int__daily_klaviyo_user_metrics is the same data type as '0'. ([#6](https://github.com/fivetran/dbt_shopify_holistic_reporting/pull/6)) + +## Contributors +- [@MisterClean](https://github.com/MisterClean) ([#6](https://github.com/fivetran/dbt_shopify_holistic_reporting/pull/6)) + + # dbt_shopify_holistic_reporting v0.1.0 The original release! This package currently models Shopify and Klaviyo data to achieve the following: @@ -5,4 +13,4 @@ The original release! This package currently models Shopify and Klaviyo data to - Consolidate customers, their information, and activity across platforms. - Create a rich portrait of customer personas based on how customers are engaging with and responding to specific marketing efforts. -This package works off of dependencies on Fivetran's individual [Shopify](https://github.com/fivetran/dbt_shopify) and [Klaviyo](https://github.com/fivetran/dbt_klaviyo) dbt packages. \ No newline at end of file +This package works off of dependencies on Fivetran's individual [Shopify](https://github.com/fivetran/dbt_shopify) and [Klaviyo](https://github.com/fivetran/dbt_klaviyo) dbt packages. diff --git a/dbt_project.yml b/dbt_project.yml index db3bc3e..0def78d 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'shopify_holistic_reporting' -version: '0.1.0' +version: '0.1.1' config-version: 2 require-dbt-version: [">=1.0.0", "<2.0.0"] @@ -43,4 +43,4 @@ vars: - 'Placed Order' - 'Ordered Product' - 'checkout started' - - 'cancelled order' \ No newline at end of file + - 'cancelled order' diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index e66d8c5..8617bc1 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'shopify_holistic_reporting_integration_tests' -version: '0.1.0' +version: '0.1.1' profile: 'integration_tests' config-version: 2 @@ -149,4 +149,4 @@ seeds: event: +column_types: flow_id: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" - campaign_id: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" \ No newline at end of file + campaign_id: "{{ 'string' if target.type in ('bigquery', 'spark') else 'varchar' }}" diff --git a/models/intermediate/int__daily_klaviyo_user_metrics.sql b/models/intermediate/int__daily_klaviyo_user_metrics.sql index a2d59be..44781a6 100644 --- a/models/intermediate/int__daily_klaviyo_user_metrics.sql +++ b/models/intermediate/int__daily_klaviyo_user_metrics.sql @@ -21,7 +21,9 @@ with events as ( -- sum up the numeric value associated with events (most likely will mean revenue) {% for rm in var('klaviyo__sum_revenue_metrics') %} - , sum(case when lower(type) = '{{ rm | lower }}' then numeric_value else 0 end) + , sum(case when lower(type) = '{{ rm | lower }}' then + coalesce({{ fivetran_utils.try_cast("numeric_value", "numeric") }}, 0) + else 0 end) as {{ 'sum_revenue_' ~ rm | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }} -- removing special characters that I have seen in different integration events {% endfor %} @@ -37,4 +39,4 @@ with events as ( -- the grain will be person-flow-campaign-variation-day select * -from pivot_out_events \ No newline at end of file +from pivot_out_events