-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs, model updates, add tests, add documentation (#16)
* docs, model updates, add tests, add documentation * add explicit tests for validation test fix, add changelog * docs and update * add decision log entry for different grains * bk * vertical integration test * packages.yml --------- Co-authored-by: Jamie Rodriguez <[email protected]>
- Loading branch information
1 parent
4d64aab
commit fc762c0
Showing
32 changed files
with
841 additions
and
61 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
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,2 +1,2 @@ | ||
packages: | ||
- local: ../ | ||
- local: ../ |
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,11 +1,11 @@ | ||
campaign_id,date,_fivetran_synced,campaign_applicable_budget_rule_id,campaign_applicable_budget_rule_name,campaign_bidding_strategy,campaign_budget_amount,campaign_budget_currency_code,campaign_budget_type,clicks,cost,impressions,campaign_rule_based_budget_amount | ||
2187,2022-07-26,2022-10-14 11:54:40.980000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-07-21,2022-10-14 11:52:57.796000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-08-29,2022-10-14 11:40:45.808000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-08-31,2022-10-14 11:42:29.065000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-07-27,2022-10-14 11:54:40.980000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-08-28,2022-10-14 11:40:45.807000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-09-06,2022-10-14 11:42:29.062000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-07-11,2022-10-14 12:07:12.424000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET0.0,2,1.67,1095, | ||
2187,2022-07-15,2022-10-14 12:07:12.428000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
2187,2022-07-18,2022-10-14 11:52:57.802000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,, | ||
campaign_id,date,_fivetran_synced,campaign_applicable_budget_rule_id,campaign_applicable_budget_rule_name,campaign_bidding_strategy,campaign_budget_amount,campaign_budget_currency_code,campaign_budget_type,clicks,cost,impressions,campaign_rule_based_budget_amount,sales_7_d,purchases_30_d,sales_30_d | ||
2187,2022-07-26,2022-10-14 11:54:40.980000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,12,44,54 | ||
2187,2022-07-21,2022-10-14 11:52:57.796000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,2,34,345 | ||
2187,2022-08-29,2022-10-14 11:40:45.808000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,,, | ||
2187,2022-08-31,2022-10-14 11:42:29.065000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,,, | ||
2187,2022-07-27,2022-10-14 11:54:40.980000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,3,35,350 | ||
2187,2022-08-28,2022-10-14 11:40:45.807000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,,, | ||
2187,2022-09-06,2022-10-14 11:42:29.062000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,4,24,335 | ||
2187,2022-07-11,2022-10-14 12:07:12.424000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET0.0,2,1.67,1095,,0,64,234 | ||
2187,2022-07-15,2022-10-14 12:07:12.428000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,,, | ||
2187,2022-07-18,2022-10-14 11:52:57.802000,,,optimizeForSales,2000.0,USD,DAILY_BUDGET,0,0.0,,,,, |
55 changes: 55 additions & 0 deletions
55
integration_tests/tests/consistency/consistency_account_report.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,55 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
account_id, | ||
sum(clicks) as clicks, | ||
sum(impressions) as impressions, | ||
sum(cost) as cost | ||
{# sum(purchases_30_d) as total_purchases_30_d, | ||
sum(sales_30_d) as total_sales_30_d #} | ||
from {{ target.schema }}_amazon_ads_prod.amazon_ads__account_report | ||
group by 1 | ||
), | ||
|
||
dev as ( | ||
select | ||
account_id, | ||
sum(clicks) as clicks, | ||
sum(impressions) as impressions, | ||
sum(cost) as cost | ||
{# sum(purchases_30_d) as total_purchases_30_d, | ||
sum(sales_30_d) as total_sales_30_d #} | ||
from {{ target.schema }}_amazon_ads_dev.amazon_ads__account_report | ||
group by 1 | ||
), | ||
|
||
final as ( | ||
select | ||
prod.account_id, | ||
prod.clicks as prod_clicks, | ||
dev.clicks as dev_clicks, | ||
prod.impressions as prod_impressions, | ||
dev.impressions as dev_impressions, | ||
prod.cost as prod_cost, | ||
dev.cost as dev_cost | ||
{# prod.purchases_30_d as prod_purchases_30_d, | ||
dev.purchases_30_d as dev_purchases_30_d, | ||
prod.sales_30_d as prod_sales_30_d, | ||
dev.sales_30_d as dev_sales_30_d #} | ||
from prod | ||
full outer join dev | ||
on dev.account_id = prod.account_id | ||
) | ||
|
||
select * | ||
from final | ||
where | ||
abs(prod_clicks - dev_clicks) >= .01 | ||
or abs(prod_impressions - dev_impressions) >= .01 | ||
or abs(prod_cost - dev_cost) >= .01 | ||
{# or abs(prod_purchases_30_d - dev_purchases_30_d) >= .01 | ||
or abs(prod_sales_30_d - dev_sales_30_d) >= .01 #} |
55 changes: 55 additions & 0 deletions
55
integration_tests/tests/consistency/consistency_ad_group_report.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,55 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
ad_group_id, | ||
sum(clicks) as clicks, | ||
sum(impressions) as impressions, | ||
sum(cost) as cost | ||
{# sum(purchases_30_d) as total_purchases_30_d, | ||
sum(sales_30_d) as total_sales_30_d #} | ||
from {{ target.schema }}_amazon_ads_prod.amazon_ads__ad_group_report | ||
group by 1 | ||
), | ||
|
||
dev as ( | ||
select | ||
ad_group_id, | ||
sum(clicks) as clicks, | ||
sum(impressions) as impressions, | ||
sum(cost) as cost | ||
{# sum(purchases_30_d) as total_purchases_30_d, | ||
sum(sales_30_d) as total_sales_30_d #} | ||
from {{ target.schema }}_amazon_ads_dev.amazon_ads__ad_group_report | ||
group by 1 | ||
), | ||
|
||
final as ( | ||
select | ||
prod.ad_group_id, | ||
prod.clicks as prod_clicks, | ||
dev.clicks as dev_clicks, | ||
prod.impressions as prod_impressions, | ||
dev.impressions as dev_impressions, | ||
prod.cost as prod_cost, | ||
dev.cost as dev_cost | ||
{# prod.purchases_30_d as prod_purchases_30_d, | ||
dev.purchases_30_d as dev_purchases_30_d, | ||
prod.sales_30_d as prod_sales_30_d, | ||
dev.sales_30_d as dev_sales_30_d #} | ||
from prod | ||
full outer join dev | ||
on dev.ad_group_id = prod.ad_group_id | ||
) | ||
|
||
select * | ||
from final | ||
where | ||
abs(prod_clicks - dev_clicks) >= .01 | ||
or abs(prod_impressions - dev_impressions) >= .01 | ||
or abs(prod_cost - dev_cost) >= .01 | ||
{# or abs(prod_purchases_30_d - dev_purchases_30_d) >= .01 | ||
or abs(prod_sales_30_d - dev_sales_30_d) >= .01 #} |
Oops, something went wrong.