fivetran / dbt_zendesk

Fivetran's Zendesk Support dbt package
https://fivetran.github.io/dbt_zendesk/#!/overview
Apache License 2.0
25 stars 30 forks source link

[Bug] Minutes in sla_policies can be inaccurate due to where rounding occurs #135

Closed fivetran-reneeli closed 4 months ago

fivetran-reneeli commented 5 months ago

Is there an existing issue for this?

Describe the issue

The calculated elapsed minutes in the zendesk__sla_policies end model can be off by a minute or so.

For example, in our sample data, ticket 69 shows an sla_elapsed_time of 4 minutes. But if you take the difference, technically it's closer to 3 minutes.

2023-10-06 20:39:58 UTC, 2023-10-06 20:43:11 UTC

This is because in int_zendesk__reply_time_combined we calculate the difference between timestamps using minute as the grain, whereas in our other models we use seconds then divide by 60.

dbt.datediff("sla_schedule_start_at", "agent_reply_at", 'minute')

More examples in this comment in https://github.com/fivetran/dbt_zendesk/pull/134.

Relevant error log or model output

No response

Expected behavior

The difference between timestamps should display more accurately. Therefore, we should calculate on the seconds grain and divide by 60 to derive minutes. This is what's presently done in our other models, so would help with standardization as well.

Finally, let's make sure this is the case for the rest of package.

dbt Project configurations

na

Package versions

na

What database are you using dbt with?

bigquery

dbt Version

na

Additional Context

No response

Are you willing to open a PR to help address this issue?

fivetran-joemarkiewicz commented 4 months ago

This has issue should now be addressed in the latest v0.14.0 release of the dbt_zendesk package. As such, closing this out.

Please feel free to reopen or create a new issue if the original issue persists following the upgrade.