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

fix(spanner): correct use of Interval offset in Timestamp addition #14121

Merged
merged 1 commit into from
May 3, 2024

Conversation

devbww
Copy link
Contributor

@devbww devbww commented May 3, 2024

When adding an Interval to a Timestamp+time-zone, the offset should be interpreted as an absolute value rather than a civil one. (This is a poor choice in my opinion, but so be it.)

Update the test case, which now has to use a "1 day" interval to show the difference between Add(ts, "1 day", tz) and Add(ts, "24 hours", tz) over a civil-time discontinuity.

Add a new test based upon the postgresql.org examples, one of which would have demonstrated the original problem.


This change is Reviewable

When adding an `Interval` to a `Timestamp`+time-zone, the offset should
be interpreted as an absolute value rather than a civil one.  (This is a
poor choice in my opinion, but so be it.)

Update the test case, which now has to use a "1 day" interval to show the
difference between `Add(ts, "1 day", tz)` and `Add(ts, "24 hours", tz)`
over a civil-time discontinuity.

Add a new test based upon the postgresql.org examples, one of which would
have demonstrated the original problem.
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.24%. Comparing base (2eb6963) to head (69fd9d8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14121      +/-   ##
==========================================
- Coverage   93.78%   93.24%   -0.55%     
==========================================
  Files        2290     2203      -87     
  Lines      199313   188898   -10415     
==========================================
- Hits       186934   176129   -10805     
- Misses      12379    12769     +390     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@devbww devbww marked this pull request as ready for review May 3, 2024 18:17
@devbww devbww requested a review from a team as a code owner May 3, 2024 18:17
Copy link
Member

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @devbww)

@devbww devbww merged commit bc37fcb into googleapis:main May 3, 2024
64 checks passed
@devbww devbww deleted the interval-extra-operations branch May 3, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants