You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "anandghegde (via GitHub)" <gi...@apache.org> on 2026/09/13 17:29:51 UTC
[PR] Move binary and byte-view cast helpers into a private submodule [arrow-rs]
anandghegde opened a new pull request, #11077:
URL: https://github.com/apache/arrow-rs/pull/11077
# Which issue does this PR close?
Part of #11032 — the **binary, fixed-size binary and byte-view helpers** group
only, so it does not close the issue.
Sibling PRs against the same issue: #11075 (temporal) and #11076 (numeric and
boolean). All three are independent and move disjoint functions, but each adds a
`mod` line and an import to `mod.rs`, so whichever lands later will want a
trivial rebase.
# Rationale for this change
`arrow-cast/src/cast/mod.rs` is ~14k lines. #5125 moved list, decimal,
dictionary, string, map, run-array and union support into private submodules,
and #11032 lists the groups still inline. The byte-oriented conversions are one
of them.
# What changes are included in this PR?
A new private `arrow-cast/src/cast/binary.rs` holding:
- `cast_numeric_to_binary`
- `cast_binary_to_fixed_size_binary`
- `cast_fixed_size_binary_to_binary`
- `cast_fixed_size_binary_to_binary_view`
- `cast_byte_container`
- `cast_view_to_byte`
`cast_with_options` stays the top-level dispatcher in `mod.rs`.
Worth flagging for review:
- **No public API surface is involved here.** Unlike the numeric group in
#11076, none of these six were `pub`, so `mod.rs` uses a plain
`use crate::cast::binary::*` rather than a `pub use`. All six are called from
the dispatcher, so all six became `pub(crate)` and nothing stayed private.
- **`cast_numeric_to_binary` is not adjacent to the rest.** It sits up with the
numeric helpers in `mod.rs` rather than with the other byte conversions, but
it belongs to this group, so it is moved from there.
- Three imports left orphaned in `mod.rs` by the move are dropped:
`arrow_data::ByteView`, and `Buffer` from the `arrow_buffer` import list.
# Are these changes tested?
Covered by the existing `arrow-cast` tests — this is a code move, so no new
tests are warranted and no existing test was modified.
```
cargo test -p arrow-cast 379 passed + 12 passed, 0 failed (same as base)
cargo clippy -p arrow-cast --all-targets -- -D warnings clean
cargo fmt -p arrow-cast -- --check clean
cargo build -p arrow builds
```
As with the sibling PRs, the faithfulness of the move is checked mechanically
rather than by eye: extracting the two original line ranges from `HEAD` and
normalising away the added `pub(crate)` gives a **byte-identical** match against
the new file.
Run on macOS 26.6.2, aarch64-apple-darwin, toolchain 1.98.1 from
`rust-toolchain.toml`.
# Are there any user-facing changes?
No. No public API change and no behavioural change.
# AI usage disclosure
Written with AI assistance (Claude). The AI performed the mechanical extraction
and ran the verification above; I reviewed the result and own the change.
The moved bodies are unedited, and the byte-identity check is the evidence for
that rather than a reading. The judgement calls — pulling `cast_numeric_to_binary`
out of the numeric neighbourhood, the uniform `pub(crate)`, and the three dropped
imports — are listed above because they are the parts a "pure move" diff would
not otherwise draw attention to.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move binary and byte-view cast helpers into a private submodule [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #11077:
URL: https://github.com/apache/arrow-rs/pull/11077
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move binary and byte-view cast helpers into a private submodule [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #11077:
URL: https://github.com/apache/arrow-rs/pull/11077#issuecomment-5953173063
could we merge up to resolve the conflict
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move binary and byte-view cast helpers into a private submodule [arrow-rs]
Posted by "anandghegde (via GitHub)" <gi...@apache.org>.
anandghegde commented on PR #11077:
URL: https://github.com/apache/arrow-rs/pull/11077#issuecomment-5958828215
Merged `main` up and resolved the conflicts — the temporal additions (DST resolution) stay in `mod.rs` on this branch since only the binary/byte-view helpers were extracted; upstream's `cast_numeric_to_binary` matches the copy in the `binary` submodule. `cargo test -p arrow-cast` (417 tests), clippy and fmt are clean.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org