-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bug/null-customer-tags * update seeds and regen docs * revisions and regen docs * review updates
- Loading branch information
1 parent
9865630
commit 903e562
Showing
14 changed files
with
120 additions
and
69 deletions.
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