Skip to content

feat: add GapInfo to timezone - #11535

Merged
alamb merged 2 commits into
apache:mainfrom
mhilton:issue-11472
Oct 15, 2026
Merged

alamb merged 2 commits into
apache:mainfrom
mhilton:issue-11472

Conversation

@mhilton

@mhilton mhilton commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

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 GapInfo types represents a new interface. There are no changes to any existing interface.

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.
@github-actions github-actions Bot added arrow-core Core crates related to representing arrow data enhancement New feature/addition labels Oct 13, 2026

@cakeni cakeni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. The gap conversion keeps the original timezone, and fixed offsets return None.

@alamb

alamb commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Would we need to update this if we changed to jiff ?

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mhilton and @cakeni

I have some small suggestions but nothing I think is required to merge

I like this new API

Comment thread arrow-array/src/timezone.rs
}

#[test]
fn test_gap_info_fixed_offset() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this test not located next to the other unit tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It tests that fixed offsets work correctly whether the chrono-tz feature is enabled or not.

@mhilton

mhilton commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Would we need to update this if we changed to jiff ?

Yes, but we'd have to change the whole module. It is entirely based around chrono data types.

Add an example for GapInfo as requested in the review.
@alamb
alamb added this pull request to the merge queue Oct 15, 2026
Merged via the queue into apache:main with commit dd24011 Oct 15, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data enhancement New feature/addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make arrow's timezone module publish gap information

3 participants