Skip to content
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

Merged

Conversation

fivetran-joemarkiewicz
Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz commented Jun 6, 2023

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:

  • dbt compile
  • dbt run –full-refresh
  • dbt run
  • dbt test
  • dbt run –vars (ran both with and without the schedule variable being true and false)

Before marking this PR as "ready for review" the following have been applied:

  • The appropriate issue has been linked and tagged
  • You are assigned to the corresponding issue and this PR
  • BuildKite integration tests are passing

Detailed Validation

Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":

  • You have validated these changes and assure this PR will address the respective Issue/Feature.
  • You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
  • You have provided details below around the validation steps performed to gain confidence in these changes.

The main steps taking to validate these changes include the following:

  • Working with a customer to ensure the SLAs are taking into account the holiday hours and are matching the expected results based on Zendesk's own internal reporting. Please see the corresponding internal ticket for more details around the specific validation efforts.
  • Confirmed the 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.

image

Standard Updates

Please acknowledge that your PR contains the following standard updates:

  • Package versioning has been appropriately indexed in the following locations:
    • indexed within dbt_project.yml
    • indexed within integration_tests/dbt_project.yml
  • CHANGELOG has individual entries for each respective change in this PR
  • README updates have been applied (if applicable)
  • [N/A] DECISIONLOG updates have been updated (if applicable)
  • [N/A] Appropriate yml documentation has been added (if applicable)

dbt Docs

Please acknowledge that after the above were all completed the below were applied to your branch:

  • docs were regenerated (unless this PR does not include any code or yml updates)

If you had to summarize this PR in an emoji, which would it be?

📆

@fivetran-joemarkiewicz fivetran-joemarkiewicz marked this pull request as ready for review June 7, 2023 18:33
Copy link
Contributor

@fivetran-jamie fivetran-jamie left a 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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,
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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

CHANGELOG.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@fivetran-jamie fivetran-jamie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@fivetran-joemarkiewicz fivetran-joemarkiewicz mentioned this pull request Jul 7, 2023
16 tasks
@fivetran-joemarkiewicz fivetran-joemarkiewicz changed the base branch from main to release/v0.11.0 July 7, 2023 21:40
@fivetran-joemarkiewicz fivetran-joemarkiewicz merged commit 8eb5d18 into release/v0.11.0 Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants