Closed justinwagg closed 4 months ago
Thanks for introducing this issue @justinwagg ! At first glance I think your changes to get the right fixed_amount_discount_amount
make sense. Let me do some verification and I'll get back to you with our plan for addressing it.
Hi @justinwagg , was able to confirm that these changes should work! We will accept this task and will fold these updates into a coming sprint.
We will let you know when we have a branch ready for you to test this change.
Thanks @fivetran-avinash :)
No problem @justinwagg ! Our next sprint start next week so we hope to have a solution ready for you to test out in the week or two after.
Hi @justinwagg , we've deployed your suggested changes live in our latest release of dbt_shopify
. Upgrade to the newest version of our package in your packages.yml
and you should be good to grab the proper fixed amount discounts. https://hub.getdbt.com/fivetran/shopify/latest/
Let me know if you have any additional questions and feel free to submit any other features or bugs that come to mind!
Is there an existing issue for this?
Describe the issue
The field
shopify__orders. fixed_amount_discount_amount
is filtering for, and aggregating Shipping discounts https://github.com/fivetran/dbt_shopify/blob/7cc06076939937265ab4e11b75a7b34c89c46000/models/shopify__orders.sql#L51Relevant error log or model output
No response
Expected behavior
The field
shopify__orders. fixed_amount_discount_amount
is is calculated and filtering forfixed_amount
coupons.dbt Project configurations
N/A
Package versions
What database are you using dbt with?
bigquery
dbt Version
Additional Context
https://shopify.dev/docs/api/admin-rest/2024-04/resources/order#resource-object shows there are three discount code types,
fixed_amount
,percentage
andshipping
. This looks like a copy/paste error, andshipping
should be updated tofixed_amount
.Ex:
Current
sum(case when type = 'shipping' then amount else 0 end) as fixed_amount_discount_amount,
Fixsum(case when type = 'fixed_amount' then amount else 0 end) as fixed_amount_discount_amount,
Are you willing to open a PR to help address this issue?