Repository navigation
feat: add GapInfo to timezone - #11535
Merged
Merged
Conversation
Add a GapInfo struct to the arrow::timezone module to publish information about gaps in local time for a timezone. This is a direct copy of the GapInfo type from chrono-tz with the types changed to be appropriate for this module.
cakeni
approved these changes
Oct 13, 2026
cakeni
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. The gap conversion keeps the original timezone, and fixed offsets return None.
Contributor
|
Would we need to update this if we changed to |
alamb
approved these changes
Oct 14, 2026
| } | ||
|
|
||
| #[test] | ||
| fn test_gap_info_fixed_offset() { |
Contributor
There was a problem hiding this comment.
why is this test not located next to the other unit tests?
Contributor
Author
There was a problem hiding this comment.
It tests that fixed offsets work correctly whether the chrono-tz feature is enabled or not.
Contributor
Author
Yes, but we'd have to change the whole module. It is entirely based around |
Add an example for GapInfo as requested in the review.
alamb
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Currently when converting from local time to UTC within a timezone if the local time represents a time within a discontinuity it is not possible to find the parameters of that discontinuity. This allows clients to find details of the gap in order to make decisions about how conversions should be performed.
What changes are included in this PR?
Add a GapInfo struct to the arrow::timezone module to publish information about gaps in local time for a timezone. This is a direct copy of the GapInfo type from chrono-tz with the types changed to be appropriate for this module.
Are these changes tested?
Yes, new unit tests
Are there any significant user-facing changes?
The new
GapInfotypes represents a new interface. There are no changes to any existing interface.