-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* get new branch on remote * send to bk * docs * joe feedback * Apply suggestions from code review Co-authored-by: fivetran-catfritz <[email protected]> * update source packege ref --------- Co-authored-by: fivetran-catfritz <[email protected]>
- Loading branch information
1 parent
7fa81ff
commit 4e495c4
Showing
71 changed files
with
874 additions
and
221 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.
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
53 changes: 53 additions & 0 deletions
53
integration_tests/tests/consistency/consistency_ticket_backlog.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,53 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
{{ dbt_utils.star(from=ref('zendesk__ticket_backlog'), except=var('consistency_test_exclude_fields', '[]')) }} | ||
from {{ target.schema }}_zendesk_prod.zendesk__ticket_backlog | ||
), | ||
|
||
dev as ( | ||
select | ||
{{ dbt_utils.star(from=ref('zendesk__ticket_backlog'), except=var('consistency_test_exclude_fields', '[]')) }} | ||
from {{ target.schema }}_zendesk_dev.zendesk__ticket_backlog | ||
|
||
{# Make sure we're only comparing one schema since this current update (v0.19.0) added mult-schema support. Can remove for future releases #} | ||
{{ "where source_relation = '" ~ (var("zendesk_database", target.database)|lower ~ "." ~ var("zendesk_schema", "zendesk")) ~ "'" if 'source_relation' in var("consistency_test_exclude_fields", '[]') }} | ||
|
||
), | ||
|
||
prod_not_in_dev as ( | ||
-- rows from prod not found in dev | ||
select * from prod | ||
except distinct | ||
select * from dev | ||
), | ||
|
||
dev_not_in_prod as ( | ||
-- rows from dev not found in prod | ||
select * from dev | ||
except distinct | ||
select * from prod | ||
), | ||
|
||
final as ( | ||
select | ||
*, | ||
'from prod' as source | ||
from prod_not_in_dev | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
select | ||
*, | ||
'from dev' as source | ||
from dev_not_in_prod | ||
) | ||
|
||
select * | ||
from final | ||
where date_day < current_date |
55 changes: 55 additions & 0 deletions
55
integration_tests/tests/consistency/consistency_ticket_enriched.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 | ||
{{ dbt_utils.star(from=ref('zendesk__ticket_enriched'), except=var('consistency_test_exclude_fields', '[]')) }} | ||
from {{ target.schema }}_zendesk_prod.zendesk__ticket_enriched | ||
where true | ||
and {{ dbt.datediff(dbt.current_timestamp(), "updated_at", "minute") }} >= 60 | ||
), | ||
|
||
dev as ( | ||
select | ||
{{ dbt_utils.star(from=ref('zendesk__ticket_enriched'), except=var('consistency_test_exclude_fields', '[]')) }} | ||
from {{ target.schema }}_zendesk_dev.zendesk__ticket_enriched | ||
where true | ||
and {{ dbt.datediff(dbt.current_timestamp(), "updated_at", "minute") }} >= 60 | ||
|
||
{# Make sure we're only comparing one schema since this current update (v0.19.0) added mult-schema support. Can remove for future releases #} | ||
{{ "and source_relation = '" ~ (var("zendesk_database", target.database)|lower ~ "." ~ var("zendesk_schema", "zendesk")) ~ "'" if 'source_relation' in var("consistency_test_exclude_fields", '[]') }} | ||
), | ||
|
||
prod_not_in_dev as ( | ||
-- rows from prod not found in dev | ||
select * from prod | ||
except distinct | ||
select * from dev | ||
), | ||
|
||
dev_not_in_prod as ( | ||
-- rows from dev not found in prod | ||
select * from dev | ||
except distinct | ||
select * from prod | ||
), | ||
|
||
final as ( | ||
select | ||
*, | ||
'from prod' as source | ||
from prod_not_in_dev | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
select | ||
*, | ||
'from dev' as source | ||
from dev_not_in_prod | ||
) | ||
|
||
select * | ||
from final |
52 changes: 52 additions & 0 deletions
52
integration_tests/tests/consistency/consistency_ticket_field_history.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,52 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
{{ dbt_utils.star(from=ref('zendesk__ticket_field_history'), except=var('consistency_test_exclude_fields', '[]')) }} | ||
from {{ target.schema }}_zendesk_prod.zendesk__ticket_field_history | ||
), | ||
|
||
dev as ( | ||
select | ||
{{ dbt_utils.star(from=ref('zendesk__ticket_field_history'), except=var('consistency_test_exclude_fields', '[]')) }} | ||
from {{ target.schema }}_zendesk_dev.zendesk__ticket_field_history | ||
|
||
{# Make sure we're only comparing one schema since this current update (v0.19.0) added mult-schema support. Can remove for future releases #} | ||
{{ "where source_relation = '" ~ (var("zendesk_database", target.database)|lower ~ "." ~ var("zendesk_schema", "zendesk")) ~ "'" if 'source_relation' in var("consistency_test_exclude_fields", '[]') }} | ||
), | ||
|
||
prod_not_in_dev as ( | ||
-- rows from prod not found in dev | ||
select * from prod | ||
except distinct | ||
select * from dev | ||
), | ||
|
||
dev_not_in_prod as ( | ||
-- rows from dev not found in prod | ||
select * from dev | ||
except distinct | ||
select * from prod | ||
), | ||
|
||
final as ( | ||
select | ||
*, | ||
'from prod' as source | ||
from prod_not_in_dev | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
select | ||
*, | ||
'from dev' as source | ||
from dev_not_in_prod | ||
) | ||
|
||
select * | ||
from final | ||
where date_day < current_date |
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.