-
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.
Merge pull request #164 from fivetran/bug/missing-sla-policies
bug/missing-sla-policies
- Loading branch information
Showing
12 changed files
with
168 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
-- check that all the tickets are accounted for in the metrics | ||
with stg_count as ( | ||
select | ||
count(*) as stg_ticket_count | ||
from {{ ref('stg_zendesk__ticket') }} | ||
), | ||
|
||
metric_count as ( | ||
select | ||
count(*) as metric_ticket_count | ||
from source | ||
from {{ ref('zendesk__ticket_metrics') }} | ||
) | ||
|
||
select * | ||
from stg_count | ||
join metric_count | ||
on stg_ticket_count != metric_ticket_count |
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) | ||
) }} | ||
|
||
/* | ||
This test is to ensure the sla_elapsed_time from zendesk__sla_policies matches the corresponding time in zendesk__ticket_metrics. | ||
*/ | ||
|
||
with dev_slas as ( | ||
select * | ||
from {{ target.schema }}_zendesk_dev.zendesk__sla_policies | ||
where in_business_hours | ||
|
||
), dev_metrics as ( | ||
select * | ||
from {{ target.schema }}_zendesk_dev.zendesk__ticket_metrics | ||
|
||
), dev_compare as ( | ||
select | ||
dev_slas.ticket_id, | ||
dev_slas.metric, | ||
cast(dev_slas.sla_elapsed_time as {{ dbt.type_int() }}) as time_from_slas, | ||
case when metric = 'agent_work_time' then dev_metrics.agent_work_time_in_business_minutes | ||
when metric = 'requester_wait_time' then dev_metrics.requester_wait_time_in_business_minutes | ||
when metric = 'first_reply_time' then dev_metrics.first_reply_time_business_minutes | ||
end as time_from_metrics | ||
from dev_slas | ||
left join dev_metrics | ||
on dev_metrics.ticket_id = dev_slas.ticket_id | ||
) | ||
|
||
select * | ||
from dev_compare | ||
where abs(time_from_slas - time_from_metrics) >= 5 | ||
{{ "and ticket_id not in " ~ var('fivetran_integrity_sla_metric_parity_exclusion_tickets',[]) ~ "" if var('fivetran_integrity_sla_metric_parity_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
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
Oops, something went wrong.