-
Notifications
You must be signed in to change notification settings - Fork 29
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/schedule holiday addition #98
Bugfix/schedule holiday addition #98
Conversation
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.
this a crazy PR lol but the logic (as far as i understand it -- i asked a couple of clarifying q's) and validation look good!
CHANGELOG.md
Outdated
- `zendesk__sla_policies` | ||
|
||
## Under the Hood: | ||
- Leveraged `dbt_date.week_start` in place of `dbt.date_trunc` for business hour metrics to more consistently capture the start of the week across warehouses. |
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.
ooh is date_trunc('week') not sunday on certain warehouses?
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.
Yup! Snowflake has it be Monday, so the dbt_date macro ensures that the week start is consistent across warehouses.
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.
oh jeez should we make issues on repos that have weekly end models or just use date_trunc('week')
? (like https://github.com/fivetran/dbt_github/blob/main/models/github__weekly_metrics.sql and https://github.com/fivetran/dbt_recharge/blob/main/models/intermediate/int_recharge__customer_daily_rollup.sql)
calculate_schedules.*, | ||
schedule_holiday.holiday_name, | ||
schedule_holiday.holiday_start_date_at, | ||
cast({{ dbt.dateadd("second", "86399", "schedule_holiday.holiday_end_date_at") }} as {{ dbt.type_timestamp() }}) as holiday_end_date_at, |
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.
so does this set the holiday_end as the last second of the day?
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.
Correct, since the holiday start and end date are the same day, I want to capture the actual start and end times. The dbt.dateadd ensures I am capturing the very last second of the day. This way I have a window of when the holiday took place.
start_time_utc, | ||
end_time_utc, | ||
holiday_week_start, | ||
cast({{ dbt.dateadd("second", "86399", "holiday_week_end") }} as {{ dbt.type_timestamp() }}) as holiday_week_end, |
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.
same q about adding 86399
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.
Yup, with 86400 seconds in a day. If I want to get the very last second of the day then I need to add this many seconds to get the ending timestamp.
version: [">=0.8.0", "<0.9.0"] | ||
# - package: fivetran/zendesk_source | ||
# version: [">=0.8.0", "<0.9.0"] | ||
- git: https://github.com/fivetran/dbt_zendesk_source.git |
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.
obligatory reminder to update 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.
lgtm!
PR Overview
This PR will address the following Issue/Feature: Issue #94
This PR will result in the following new package version:
v0.11.0
This update will result in a breaking change as we are introducing a new component to the schedule spine that fuels the downstream SLA and other reports. These reports are incremental and we will want to capture the historical holiday schedule information in this latest update. Therefore, this should be a breaking change to inform users that they should run a full refresh to capture the historical data.
Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
The main steps taking to validate these changes include the following:
int_zendesk__schedule_spine
model (the one with the majority of the updates) resulted in the appropriate and complete schedule spine. When looking at a before and after you can see the schedule spine is now properly taking into account holidays and displaying the appropriate schedules for those periods. See in the screenshot below how the winter holidays (Christmas and Boxing day in this case) are accounted for mixed in with the pre-existing schedule.Standard Updates
Please acknowledge that your PR contains the following standard updates:
dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
If you had to summarize this PR in an emoji, which would it be?
📆