Skip to content

fix(arrow-cast): reject leap seconds in time strings - #12286

Open
AmanBoronbaev wants to merge 1 commit into
apache:mainfrom
AmanBoronbaev:fix/gh5335-reject-time-leap-seconds
Open

AmanBoronbaev wants to merge 1 commit into
apache:mainfrom
AmanBoronbaev:fix/gh5335-reject-time-leap-seconds

Conversation

@AmanBoronbaev

@AmanBoronbaev AmanBoronbaev commented Nov 16, 2026 •

Copy link
Copy Markdown

Which issue does this PR close?

Closes #5335.

Rationale for this change

Arrow time types cannot represent leap seconds. Parsing 23:59:60 currently produces a value outside the permitted time-of-day range, while 08:08:60 silently becomes the following minute.

What changes are included in this PR?

Reject second 60 in the time parser and reject Chrono's leap-second representation when parsing with an explicit format. Document this behavior on string_to_time_nanoseconds.

Are these changes tested?

Regression tests cover all four Time32/Time64 units, midnight and the last representable instant of the day, fractional leap seconds, AM/PM, surrounding whitespace, and explicit formats. The string-cast tests cover null-on-failure and strict errors for Utf8, LargeUtf8, and Utf8View inputs. The updated regression cases fail on the original implementation.

Fork CI passed, including the Arrow and Parquet test suites and cross-language integration.

@boring-cyborg boring-cyborg Bot added the arrow-kernels Crates that transform arrow data (e.g. compute, cast) label Nov 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-kernels Crates that transform arrow data (e.g. compute, cast)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explicitly don't support leap seconds for Time32/Time64 arrays when parsing

1 participant