-
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
Bug/null customer tags #89
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
id,first_name,last_name,email,phone,state,orders_count,total_spent,created_at,updated_at,accepts_marketing,tax_exempt,verified_email,default_address_id,_fivetran_synced | ||
3588998496353,29e00d3659d1c5e75f99e892f0c1a1f1,3f0e6a46fb84eb1e6f5f00d86aa53b1b,ab0bf25ab8b2a6b78af26a141dd6f455,,disabled,0,0,2020-09-11 13:26:15.000 ,2020-09-11 13:26:15.000 ,FALSE,FALSE,TRUE,3951726461025,2020-09-12 00:14:04.512 | ||
3589760876641,f0962b7a185488ecb752cedac1038349,aa35cb67c26e64bb81a1bf3f17e858ba,021cb20b5c78751fc7ddc091b6b69b3e,,invited,1,2.8,2020-09-11 19:35:42.000 ,2020-09-11 19:41:04.000 ,TRUE,FALSE,TRUE,3952669655137,2020-09-12 00:14:04.506 | ||
3584045351009,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,dce90c7b4e52e045e5975836aff49cf1,,disabled,2,9.18,2020-09-09 22:57:44.000 ,2020-09-09 23:01:55.000 ,FALSE,FALSE,TRUE,3946055729249,2020-09-10 00:13:59.106 | ||
3584045351009,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,dce90c7b4e52e045e5975836aff49cf1,,disabled,2,9.18,2020-09-09 22:57:44.000 ,2020-09-09 23:01:55.000 ,FALSE,FALSE,TRUE,3946055729249,2020-09-10 00:13:59.106 | ||
3584045351010,d3bae70c9d49bb7cb5a74cdd0eae7fc4,0dd89cff60965dff8f9ea2bc952a5474,dce90c7b4e52e045e5975836aff49cf1,,disabled,2,9.18,2020-09-09 22:57:44.000 ,2020-09-09 23:01:55.000 ,FALSE,FALSE,TRUE,3946055729249,2020-09-10 00:13:59.106 |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
customer_id,index,_fivetran_synced,value | ||
9919268,1,2022-12-03 06:49:03.314000,GGPP | ||
4404,1,2022-12-03 06:48:53.295000,GGPP | ||
5509188,1,2022-12-03 06:48:55.067000,GGPP | ||
5509188,1,2022-12-03 06:48:55.067000,GGPP | ||
3589760876641,1,2022-12-03 06:48:55.067000,GGPP | ||
3584045351010,1,2022-12-03 06:48:55.067000,GGPP |
31 changes: 31 additions & 0 deletions
31
integration_tests/tests/consistency/consistency_customers.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,31 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select * | ||
from {{ target.schema }}_shopify_prod.shopify__customers | ||
), | ||
|
||
dev as ( | ||
select * | ||
from {{ target.schema }}_shopify_dev.shopify__customers | ||
), | ||
|
||
final as ( | ||
-- test will fail if any rows from prod are not found in dev | ||
(select * from prod | ||
except distinct | ||
select * from dev) | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
-- test will fail if any rows from dev are not found in prod | ||
(select * from dev | ||
except distinct | ||
select * from prod) | ||
) | ||
|
||
select * | ||
from final |
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,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, | ||
array_length(split(customer_tags, ',')) as transform_customer_tag_count -- Only BigQuery compatible for the time being | ||
from {{ target.schema }}_shopify_dev.shopify__customers | ||
where customer_tags is not null | ||
group by customer_id, customer_tags | ||
), | ||
|
||
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 |
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
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.
Thank you for remembering to make this change!