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/leap-year-lookback #46

Merged
merged 5 commits into from
Mar 7, 2024
Merged

Conversation

fivetran-joemarkiewicz
Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz commented Mar 6, 2024

PR Overview

This PR will address the following Issue/Feature: Issue #45

This PR will result in the following new package version: v0.6.2

This is adding a new case statement to logic in order to ensure users with a fiscal year end on the 29th of February do not see error messages due to the dateadd -1 logic creating a date that does not exist. Since the 29th in the previous year would not exist.

Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:

Bug Fixes

  • Update to the xero__balance_sheet model to ensure the calculated current_year_end_date field takes into account fiscal year ends which are occur on a leap year. To address this, if a lookback is required then the 28th of the previous year will be used to ensure an accurate date is used.

Under the Hood

  • Included auto-releaser GitHub Actions workflow to automate future releases.
  • Updated the maintainer PR template to resemble the most up to date format.

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt run –full-refresh && dbt test
  • dbt run (if incremental models are present) && dbt test

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

  • The appropriate issue has been linked, tagged, and properly assigned
  • All necessary documentation and version upgrades have been applied
  • docs were regenerated (unless this PR does not include any code or yml updates)
  • BuildKite integration tests are passing
  • Detailed validation steps have been provided below

Detailed Validation

Please share any and all of your validation steps:

To validate this I was able to update the seed data to include the 29th of February as the fiscal year end. I was then able to recreate the issue on the live version of the package.

image

Then following the application of the changes in this branch I was able to see the error be resolved.

image

Finally I was able to confirm that the ending date was 2023-02-28 as expected and would not result in an error on Snowflake or other warehouses due to it not being an accurate date.

image

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

📆

@fivetran-joemarkiewicz fivetran-joemarkiewicz self-assigned this Mar 6, 2024
@fivetran-joemarkiewicz fivetran-joemarkiewicz marked this pull request as ready for review March 6, 2024 23:23
Copy link
Contributor

@fivetran-catfritz fivetran-catfritz left a comment

Choose a reason for hiding this comment

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

lgtm! I also tried this out with a few other dates like 1/29 and 4/24, and all looks to be working as expected.

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.

looks good! just one suggestion in the changelog

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com>
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 merged commit b2a7e60 into main Mar 7, 2024
8 checks passed
@fivetran-joemarkiewicz fivetran-joemarkiewicz deleted the bugfix/leap-year-lookback branch March 7, 2024 18:16
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.

3 participants