-
Notifications
You must be signed in to change notification settings - Fork 35
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
Continuation of #88 - handle multiple disputes in stripe__balance_transactions #92
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
78ee45e
fix!: handle multiple disputes (#88)
bramrodenburg 8bffa15
merge main
fivetran-jamie 11051fc
changes
fivetran-jamie 88ad86e
aws and changelog
fivetran-jamie d98754f
validations
fivetran-jamie 1512cfd
Update models/stripe__balance_transactions.sql
fivetran-jamie 3fec3ee
renee feedback
fivetran-jamie 8598cf7
Merge branch 'releases/v0.15.latest' of https://github.com/fivetran/d…
fivetran-jamie c79f807
docs
fivetran-jamie 512dfb4
update package ref
fivetran-jamie 986f12a
changelog
fivetran-jamie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fivetran-avinash marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
integration_tests/tests/consistency/consistency_activity_itemized_2.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select balance_transaction_id, dispute_id as dispute_ids -- we don't have multi-dispute records in our data | ||
from {{ target.schema }}_stripe_prod.stripe__activity_itemized_2 | ||
), | ||
|
||
dev as ( | ||
select balance_transaction_id, dispute_ids | ||
from {{ target.schema }}_stripe_dev.stripe__activity_itemized_2 | ||
) | ||
|
||
-- test will return values and fail if the values are different (which they shouldn't be in our test data) | ||
select * | ||
from prod | ||
join dev | ||
on prod.balance_transaction_id = dev.balance_transaction_id | ||
where prod.dispute_ids != dev.dispute_ids |
21 changes: 21 additions & 0 deletions
21
integration_tests/tests/consistency/consistency_balance_change_from_activity_itemized_3.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select balance_transaction_id, dispute_reason as dispute_reasons -- we don't have multi-dispute records in our data | ||
from {{ target.schema }}_stripe_prod.stripe__balance_change_from_activity_itemized_3 | ||
), | ||
|
||
dev as ( | ||
select balance_transaction_id, dispute_reasons | ||
from {{ target.schema }}_stripe_dev.stripe__balance_change_from_activity_itemized_3 | ||
) | ||
|
||
-- test will return values and fail if the values are different (which they shouldn't be in our test data) | ||
select * | ||
from prod | ||
join dev | ||
on prod.balance_transaction_id = dev.balance_transaction_id | ||
where prod.dispute_reasons != dev.dispute_reasons |
32 changes: 32 additions & 0 deletions
32
integration_tests/tests/consistency/consistency_balance_transcations_count.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
-- this test is to make sure the rows counts are the same between versions | ||
with prod as ( | ||
select | ||
count(*) as prod_rows, | ||
sum(customer_facing_amount) as customer_facing_amount, | ||
sum(balance_transaction_amount) as balance_transaction_amount, | ||
sum(balance_transaction_net) as balance_transaction_net | ||
from {{ target.schema }}_stripe_prod.stripe__balance_transactions | ||
), | ||
|
||
dev as ( | ||
select | ||
count(*) as dev_rows, | ||
sum(customer_facing_amount) as customer_facing_amount, | ||
sum(balance_transaction_amount) as balance_transaction_amount, | ||
sum(balance_transaction_net) as balance_transaction_net | ||
from {{ target.schema }}_stripe_dev.stripe__balance_transactions | ||
) | ||
|
||
-- test will return values and fail if the row counts don't match | ||
select * | ||
from prod | ||
join dev | ||
on prod.prod_rows != dev.dev_rows | ||
or prod.customer_facing_amount != dev.customer_facing_amount | ||
or prod.balance_transaction_amount != dev.balance_transaction_amount | ||
or prod.balance_transaction_net != dev.balance_transaction_net |
21 changes: 21 additions & 0 deletions
21
...on_tests/tests/consistency/consistency_ending_balance_reconciliation_itemized_4_count.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select balance_transaction_id, dispute_reason as dispute_reasons -- we don't have multi-dispute records in our data | ||
from {{ target.schema }}_stripe_prod.stripe__ending_balance_reconciliation_itemized_4 | ||
), | ||
|
||
dev as ( | ||
select balance_transaction_id, dispute_reasons | ||
from {{ target.schema }}_stripe_dev.stripe__ending_balance_reconciliation_itemized_4 | ||
) | ||
|
||
-- test will return values and fail if the values are different (which they shouldn't be in our test data) | ||
select * | ||
from prod | ||
join dev | ||
on prod.balance_transaction_id = dev.balance_transaction_id | ||
where prod.dispute_reasons != dev.dispute_reasons |
27 changes: 27 additions & 0 deletions
27
integration_tests/tests/integrity/integrity_balance_transactions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with staging_model as ( | ||
select | ||
count(*) as row_count, | ||
sum(amount) as balance_transaction_amount, | ||
sum(net) as balance_transaction_net | ||
from {{ ref('stg_stripe__balance_transaction') }} | ||
), | ||
|
||
end_model as ( | ||
select | ||
count(*) as row_count, | ||
sum(balance_transaction_amount) as balance_transaction_amount, | ||
sum(balance_transaction_net) as balance_transaction_net | ||
from {{ ref('stripe__balance_transactions') }} | ||
) | ||
|
||
select * | ||
from staging_model | ||
join end_model | ||
on staging_model.row_count != end_model.row_count | ||
or staging_model.balance_transaction_amount != end_model.balance_transaction_amount | ||
or staging_model.balance_transaction_net != end_model.balance_transaction_net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can do emojis in Changelogs/releases anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢 you're right