fivetran/dbt_zendesk

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

Closed this issue · 1 comments

Is there an existing issue for this?

  • I have searched the existing issues

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 #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?

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

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.