fix(arrow-cast): check remaining temporal cast overflows - #10907
Open
yinli-systems wants to merge 2 commits into
Open
fix(arrow-cast): check remaining temporal cast overflows#10907yinli-systems wants to merge 2 commits into
yinli-systems wants to merge 2 commits into
Conversation
Jefffrey
reviewed
Aug 29, 2026
Respect CastOptions when Time64 conversions narrow or multiply and when Date64 conversions increase timestamp precision. Safe casts produce nulls for overflowing values, while unsafe casts return errors. Tests: - cargo test -p arrow-cast - cargo +stable fmt --all -- --check - cargo clippy -p arrow-cast --all-targets --all-features -- -D warnings AI assistance: Codex assisted with auditing the temporal cast paths and preparing the implementation and tests. Human review is required before submission.
yinli-systems
force-pushed
the
kevin/audit-temporal-cast-safety-10131
branch
from
September 2, 2026 19:58
2650875 to
0fbc616
Compare
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.
Fixes #10131.
Human review and ownership
I reviewed the final diff and understand the checked conversion approach, the safe and unsafe cast semantics, and the regression coverage. I can debug and own this change.
Summary
CastOptionswhenTime64values are narrowed toTime32.Time64(Microsecond)toTime64(Nanosecond).Date64precision increases through the existing checked timestamp conversion.The original examples were fixed by #10162. This change covers the remaining audited paths:
Time64(us/ns) -> Time32(s/ms),Time64(us) -> Time64(ns), andDate64 -> Timestamp(us/ns).Validation
2c50074c: the Time64 test returned non-null truncated values, and the Date64 test panicked withattempt to multiply with overflow.cargo test -p arrow-cast: 377 unit tests and 11 doctests passed.cargo +stable fmt --all -- --checkpassed.cargo clippy -p arrow-cast --all-targets --all-features -- -D warningspassed.git diff upstream/main...HEAD --checkpassed.AI assistance
Codex assisted with auditing temporal conversion paths, preparing the implementation and regression tests, updating the branch onto current
main, and running the validation above. The contributor reviewed the final diff and confirmed understanding and ownership before submission.