Skip to content

Commit

Permalink
revisions and regen docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-catfritz committed Oct 18, 2024
1 parent 7099937 commit b8fab76
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .quickstart/quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ public_models: [
"shopify__products",
"shopify__transactions",
"shopify__customers",
"shopify__order_lines",
"shopify__line_item_enhanced"
"shopify__order_lines"
]
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# dbt_shopify v0.13.2
[PR #89](https://github.com/fivetran/dbt_shopify/pull/89) includes the following changes:

## Bug Fixes
- Fixed an issue where the `shopify__customers` model incorrectly displayed NULL values for the `customer_tags` field for customers without orders. Updated the logic to ensure customer tags are retrieved even if no orders have been placed for that customer.

## Under the Hood
- Updated seed data to include customers without orders, verifying that their tags are correctly pulled through.
- Added consistency and integrity tests for the `shopify__customers` model to ensure accurate handling of customer tags for all customers.

# dbt_shopify v0.13.1
[PR #87](https://github.com/fivetran/dbt_shopify/pull/87) includes the following changes:

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'shopify'
version: '0.13.1'
version: '0.13.2'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'shopify_integration_tests'
version: '0.13.1'
version: '0.13.2'
profile: 'integration_tests'
config-version: 2

Expand All @@ -12,6 +12,7 @@ vars:
## Uncomment when regenerating docs
# shopify_using_fulfillment_event: true
# shopify_using_all_metafields: true
# shopify__standardized_billing_model_enabled: true

shopify_schema: shopify_integration_tests_11
shopify_source:
Expand Down
35 changes: 35 additions & 0 deletions integration_tests/tests/integrity/integrity_customers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
) }}

with source as (
select
customer_id,
count(*) as source_customer_tag_count
from {{ target.schema }}_shopify_dev.stg_shopify__customer_tag
group by 1
),

transform as (
select
customer_id,
count(*) as transform_customer_tag_count
from {{ target.schema }}_shopify_dev.shopify__customers
where customer_tags is not null
group by 1
),

compare as (
select
source.customer_id,
source.source_customer_tag_count,
transform.transform_customer_tag_count
from source
full outer join transform
on source.customer_id = transform.customer_id
where source.source_customer_tag_count != transform.transform_customer_tag_count
)

select *
from compare
19 changes: 0 additions & 19 deletions models/intermediate/shopify__customers__order_aggregates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,11 @@ with orders as (
from transactions
{{ dbt_utils.group_by(n=3) }}

{# ), customer_tags as (

select *
from {{ var('shopify_customer_tag' )}}

), customer_tags_aggregated as (

select
customer_id,
source_relation,
{{ fivetran_utils.string_agg("distinct cast(value as " ~ dbt.type_string() ~ ")", "', '") }} as customer_tags

from customer_tags
group by 1,2 #}

), aggregated as (

select
orders.customer_id,
orders.source_relation,
{# customer_tags_aggregated.customer_tags, #}
min(orders.created_timestamp) as first_order_timestamp,
max(orders.created_timestamp) as most_recent_order_timestamp,
avg(transaction_aggregates.currency_exchange_calculated_amount) as avg_order_value,
Expand Down Expand Up @@ -80,9 +64,6 @@ with orders as (
left join order_aggregates
on orders.order_id = order_aggregates.order_id
and orders.source_relation = order_aggregates.source_relation
{# left join customer_tags_aggregated
on orders.customer_id = customer_tags_aggregated.customer_id
and orders.source_relation = customer_tags_aggregated.source_relation #}

{{ dbt_utils.group_by(n=2) }}
)
Expand Down

0 comments on commit b8fab76

Please sign in to comment.