-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bugfix/remianing sla issues #154
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
25fa2a8
bugfix/remianing-sla-issues
fivetran-joemarkiewicz 4e1a190
validation additions
fivetran-joemarkiewicz 7a2fded
changelog addition
fivetran-joemarkiewicz 82fe174
Update CHANGELOG.md
fivetran-joemarkiewicz aacac2c
Update CHANGELOG.md
fivetran-joemarkiewicz e31fe17
moving tests and adding new ones
fivetran-joemarkiewicz 9dd0623
changelog update and requirements limit
fivetran-joemarkiewicz cc12e00
Update CHANGELOG.md
fivetran-joemarkiewicz 78b0f45
dics
fivetran-reneeli 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: 'zendesk' | ||
version: '0.15.0' | ||
version: '0.16.0' | ||
|
||
|
||
config-version: 2 | ||
|
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 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,7 +1,7 @@ | ||
dbt-snowflake>=1.3.0,<2.0.0 | ||
dbt-bigquery>=1.3.0,<2.0.0 | ||
dbt-redshift>=1.3.0,<2.0.0 | ||
dbt-postgres>=1.3.0,<2.0.0 | ||
dbt-spark>=1.3.0,<2.0.0 | ||
dbt-spark[PyHive]>=1.3.0,<2.0.0 | ||
dbt-databricks>=1.6.0,<2.0.0 | ||
dbt-snowflake>=1.3.0,<1.8.0 | ||
dbt-bigquery>=1.3.0,<1.8.0 | ||
dbt-redshift>=1.3.0,<1.8.0 | ||
dbt-postgres>=1.3.0,<1.8.0 | ||
dbt-spark>=1.3.0,<1.8.0 | ||
dbt-spark[PyHive]>=1.3.0,<1.8.0 | ||
dbt-databricks>=1.6.0,<1.8.0 | ||
47 changes: 47 additions & 0 deletions
47
integration_tests/tests/consistency/consistency_sla_policies.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,47 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
ticket_id, | ||
metric, | ||
sla_applied_at, | ||
sla_elapsed_time, | ||
is_sla_breach | ||
from {{ target.schema }}_zendesk_prod.zendesk__sla_policies | ||
), | ||
|
||
dev as ( | ||
select | ||
ticket_id, | ||
metric, | ||
sla_applied_at, | ||
sla_elapsed_time, | ||
is_sla_breach | ||
from {{ target.schema }}_zendesk_dev.zendesk__sla_policies | ||
), | ||
|
||
final as ( | ||
select | ||
prod.ticket_id, | ||
prod.metric, | ||
prod.sla_applied_at, | ||
prod.sla_elapsed_time as prod_sla_elapsed_time, | ||
dev.sla_elapsed_time as dev_sla_elapsed_time, | ||
prod.is_sla_breach as prod_is_sla_breach, | ||
dev.is_sla_breach as dev_is_sla_breach | ||
from prod | ||
full outer join dev | ||
on dev.ticket_id = prod.ticket_id | ||
and dev.metric = prod.metric | ||
and dev.sla_applied_at = prod.sla_applied_at | ||
) | ||
|
||
select * | ||
from final | ||
where (abs(prod_sla_elapsed_time - dev_sla_elapsed_time) >= 5 | ||
or prod_is_sla_breach != dev_is_sla_breach) | ||
{{ "and prod.ticket_id not in " ~ var('fivetran_consistency_sla_policies_exclusion_tickets',[]) ~ "" if var('fivetran_consistency_sla_policies_exclusion_tickets',[]) }} |
35 changes: 35 additions & 0 deletions
35
integration_tests/tests/consistency/consistency_sla_policy_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,35 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
1 as join_key, | ||
count(*) as total_slas | ||
from {{ target.schema }}_zendesk_prod.zendesk__sla_policies | ||
group by 1 | ||
), | ||
|
||
dev as ( | ||
select | ||
1 as join_key, | ||
count(*) as total_slas | ||
from {{ target.schema }}_zendesk_dev.zendesk__sla_policies | ||
group by 1 | ||
), | ||
|
||
final as ( | ||
select | ||
prod.join_key, | ||
prod.total_slas as prod_sla_total, | ||
dev.total_slas as dev_sla_total | ||
from prod | ||
full outer join dev | ||
on dev.join_key = prod.join_key | ||
) | ||
|
||
select * | ||
from final | ||
where prod_sla_total != dev_sla_total |
39 changes: 39 additions & 0 deletions
39
integration_tests/tests/consistency/consistency_ticket_metrics.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,39 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with prod as ( | ||
select | ||
ticket_id, | ||
first_reply_time_business_minutes, | ||
first_reply_time_calendar_minutes | ||
from {{ target.schema }}_zendesk_prod.zendesk__ticket_metrics | ||
), | ||
|
||
dev as ( | ||
select | ||
ticket_id, | ||
first_reply_time_business_minutes, | ||
first_reply_time_calendar_minutes | ||
from {{ target.schema }}_zendesk_dev.zendesk__ticket_metrics | ||
), | ||
|
||
final as ( | ||
select | ||
prod.ticket_id, | ||
prod.first_reply_time_business_minutes as prod_first_reply_time_business_minutes, | ||
dev.first_reply_time_business_minutes as dev_first_reply_time_business_minutes, | ||
prod.first_reply_time_calendar_minutes as prod_first_reply_time_calendar_minutes, | ||
dev.first_reply_time_calendar_minutes as dev_first_reply_time_calendar_minutes | ||
from prod | ||
full outer join dev | ||
on dev.ticket_id = prod.ticket_id | ||
) | ||
|
||
select * | ||
from final | ||
where (abs(prod_first_reply_time_business_minutes - dev_first_reply_time_business_minutes) >= 5 | ||
or abs(prod_first_reply_time_calendar_minutes - dev_first_reply_time_calendar_minutes) >= 5) | ||
{{ "and ticket_id not in " ~ var('fivetran_consistency_ticket_metrics_exclusion_tickets',[]) ~ "" if var('fivetran_consistency_ticket_metrics_exclusion_tickets',[]) }} |
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,47 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
-- The necessary source and source_filter adjustments used below originate from the int_zendesk__sla_policy_applied model | ||
with source as ( | ||
select | ||
*, | ||
case when field_name = 'first_reply_time' then row_number() over (partition by ticket_id, field_name order by valid_starting_at desc) else 1 end as latest_sla | ||
from {{ ref('stg_zendesk__ticket_field_history') }} | ||
), | ||
|
||
source_filter as ( | ||
select | ||
ticket_id, | ||
count(*) as source_row_count | ||
from source | ||
where field_name in ('next_reply_time', 'first_reply_time', 'agent_work_time', 'requester_wait_time') | ||
and value is not null | ||
and latest_sla = 1 | ||
group by 1 | ||
), | ||
|
||
sla_policies as ( | ||
select | ||
ticket_id, | ||
count(*) as end_model_row_count | ||
from {{ ref('zendesk__sla_policies') }} | ||
group by 1 | ||
), | ||
|
||
match_check as ( | ||
select | ||
sla_policies.ticket_id, | ||
end_model_row_count, | ||
source_row_count | ||
from sla_policies | ||
full outer join source_filter | ||
on source_filter.ticket_id = sla_policies.ticket_id | ||
) | ||
|
||
select * | ||
from match_check | ||
where end_model_row_count != source_row_count | ||
{{ "and ticket_id not in " ~ var('fivetran_integrity_sla_count_match_tickets',[]) ~ "" if var('fivetran_integrity_sla_count_match_tickets',[]) }} |
36 changes: 36 additions & 0 deletions
36
integration_tests/tests/integrity/sla_first_reply_time_match.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,36 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
with ticket_metrics as ( | ||
select | ||
ticket_id, | ||
first_reply_time_business_minutes | ||
from {{ ref('zendesk__ticket_metrics') }} | ||
), | ||
|
||
sla_policies as ( | ||
select | ||
ticket_id, | ||
sla_elapsed_time | ||
from {{ ref('zendesk__sla_policies') }} | ||
where metric = 'first_reply_time' | ||
and in_business_hours | ||
), | ||
|
||
match_check as ( | ||
select | ||
ticket_metrics.ticket_id, | ||
ticket_metrics.first_reply_time_business_minutes, | ||
sla_policies.sla_elapsed_time | ||
from ticket_metrics | ||
full outer join sla_policies | ||
on ticket_metrics.ticket_id = sla_policies.ticket_id | ||
) | ||
|
||
select * | ||
from match_check | ||
where abs(round(first_reply_time_business_minutes,0) - round(sla_elapsed_time,0)) >= 2 | ||
{{ "and ticket_id not in " ~ var('fivetran_integrity_sla_first_reply_time_exclusion_tickets',[]) ~ "" if var('fivetran_integrity_sla_first_reply_time_exclusion_tickets',[]) }} |
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.
Limiting this for the time being. Until we are able to figure out what changes we need to make for 1.8.0 compatibility in our integration tests