mayank172900 opened a new pull request, #10516: URL: https://github.com/apache/arrow-rs/pull/10516
# Which issue does this PR close? - Closes #4555. # Rationale for this change `arrow-cast` can format durations as strings but does not currently support casting those strings back to duration arrays. This leaves duration casts asymmetric and prevents round-tripping formatted values. # What changes are included in this PR? - Allow `Utf8`, `LargeUtf8`, and `Utf8View` values to cast to all four duration units. - Parse human-readable interval-style durations and the ISO 8601 representation emitted by the duration formatter. - Treat unitless integers as values in the target duration unit. - Reject year and month fields because they do not have fixed durations. - Preserve safe-cast behavior by converting invalid inputs to nulls and returning errors for unsafe casts. # Are these changes tested? Yes. Tests cover all duration units, all supported string representations, safe and unsafe behavior, invalid calendar units, and ISO 8601 and pretty-format round trips. Validation performed: - `cargo test -p arrow-cast --lib` (363 passed) - `cargo clippy -p arrow-cast --lib --tests -- -D warnings` - `cargo fmt --all -- --check` # Are there any user-facing changes? Yes. Users can now cast string arrays to duration arrays. This adds functionality without changing an existing public API. # Tooling disclosure Generative tooling assisted with the parser implementation, cast dispatch arms, tests, and PR wording. The full patch was locally reviewed and verified with the checks above. This draft should be marked ready only after the contributor has reviewed every detail and is prepared to own and debug the changes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
