-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in models/shopify__transactions.sql Related to Calculated Exchange Rates for Refunds #69
Comments
Hi @jmussitsch thank you so much for opening this issue and raising the differences with the refunds JSON object to our team. This is something we will want to address in our package. Is it consistent with your data that all refunds have a corresponding |
Hi @jmussitsch! We will be folding this into an upcoming sprint and appreciate you flagging this. Just wanted to see if you had any reservations about what Joe suggested above as potential solutions? |
Hi @fivetran-joemarkiewicz @fivetran-reneeli , I can confirm that running the following SQL yields no rows:
So seems like there is always a
I would think this would be an issue as well.... |
Hi @jmussitsch thanks for checking. Hmm, so looks like json structure for Ideally we can provide full coverage of exchange rates across all different payment gateways. This looks to be more nuanced than originally expected. My main question is regarding gateways, such as the Paypal one you've shown, that don't provide an exchange rate (based on the json you've shared I'm not seeing it), how do you calculate your shop currency's amount then? Secondly, other than using |
Hi @jmussitsch, we are picking this up this sprint! Wanted to ask-- if you divided So for CRC, if done this way, would you get a rate close to ~ 0.0019 USD to 1 CRC? |
Hi @jmussitsch , just checking up on the above. I'd be curious to know if the And secondly, if you do have those fields, I want to see if the above method would work in calculating exchange rate. |
Is there an existing issue for this?
Describe the issue
The exchange rate related columns are calculated via this code:
However, the structure of the JSON object in the
receipt
column is different for refunds. This leads to theexchange_rate
field always falling back to the coalesced value of 1 for refunds transactions. This is subtle for conversions close to 1.0 but become very problematic for conversions rates that are not close to 1.0. For example, CRC which has a rate of ~ 0.0019 USD to 1 CRC.Relevant error log or model output
refund
name: chabi
version: 1.0.0
config-version: 2
profile: '{{ env_var(''DBT_PROFILE'', '''') }}'
model-paths:
analysis-paths:
test-paths:
seed-paths:
macro-paths:
snapshot-paths:
target-path: target
clean-targets:
models:
+persist_docs:
relation: true
columns: true
+sql_header: alter session set timezone = 'America/Los_Angeles'; alter session set week_start = 1; alter session set TIMESTAMP_TYPE_MAPPING = TIMESTAMP_LTZ;
ad_reporting:
+schema:
intermediate:
+schema: stg
klaviyo:
+schema:
intermediate:
+schema: stg
+materialized: table
klaviyo_source:
+schema: stg
shopify:
+schema:
shopify_source:
+schema: stg
shopify_holistic_reporting:
+schema:
intermediate:
+schema: stg
microsoft_ads:
+schema: stg
microsoft_ads_source:
+schema: stg
amazon_ads:
+schema: stg
amazon_ads_source:
+schema: stg
google_ads:
+schema: stg
google_ads_source:
+schema: stg
tiktok_ads:
+schema: stg
tiktok_ads_source:
+schema: stg
facebook_ads:
+schema: stg
facebook_ads_source:
+schema: stg
snapchat_ads:
+schema: stg
snapchat_ads_source:
+schema: stg
vars:
iana_timezone: America/Los_Angeles
snapchat_schema: SNAPCHAT_ADS
pinterest_schema:
amazon_ads_schema: AMAZON_ADS
google_ads_schema: GOOGLE_ADS
tiktok_ads_schema: TIKTOK_ADS
facebook_ads_schema: FACEBOOK_ADS
linkedin_ads_schema:
microsoft_ads_schema: BINGADS1
pinterest__using_keywords: false
ad_reporting__amazon_ads_enabled: true
ad_reporting__google_ads_enabled: true
ad_reporting__reddit_ads_enabled: false
ad_reporting__tiktok_ads_enabled: true
ad_reporting__twitter_ads_enabled: false
ad_reporting__facebook_ads_enabled: true
ad_reporting__linkedin_ads_enabled: false
ad_reporting__snapchat_ads_enabled: true
ad_reporting__microsoft_ads_enabled: true
ad_reporting__pinterest_ads_enabled: false
amazon_ads__portfolio_history_enabled: false
ad_reporting__apple_search_ads_enabled: false
klaviyo_schema: KLAVIYO
shopify_schema: SHOPIFY
packages:
version: 0.9.0
version:
version: 1.5.0
version: 0.5.0
version: 0.8.1
version: 0.4.0
Core:
Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Plugins:
At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
The text was updated successfully, but these errors were encountered: