Move binary and byte-view cast helpers into a private submodule - #11077
Open
anandghegde wants to merge 1 commit into
Open
anandghegde wants to merge 1 commit into
anandghegde wants to merge 1 commit into
Conversation
Follow-up to apache#5125, continuing the extractions in apache#5537 and friends. Move the binary, fixed-size binary and byte-view conversion helpers out of `arrow-cast/src/cast/mod.rs` into a private `binary` submodule, leaving `cast_with_options` as the top-level dispatcher. The bodies are moved verbatim. All six helpers are called from the dispatcher and become `pub(crate)`; none of them were public, so nothing is added to or removed from the crate's public API. No behavioural change and no public API change.
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.
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
modline and an import tomod.rs, so whichever lands later will want atrivial rebase.
Rationale for this change
arrow-cast/src/cast/mod.rsis ~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.rsholding:cast_numeric_to_binarycast_binary_to_fixed_size_binarycast_fixed_size_binary_to_binarycast_fixed_size_binary_to_binary_viewcast_byte_containercast_view_to_bytecast_with_optionsstays the top-level dispatcher inmod.rs.Worth flagging for review:
Move numeric and boolean cast helpers into a private submodule #11076, none of these six were
pub, somod.rsuses a plainuse crate::cast::binary::*rather than apub use. All six are called fromthe dispatcher, so all six became
pub(crate)and nothing stayed private.cast_numeric_to_binaryis not adjacent to the rest. It sits up with thenumeric helpers in
mod.rsrather than with the other byte conversions, butit belongs to this group, so it is moved from there.
mod.rsby the move are dropped:arrow_data::ByteView, andBufferfrom thearrow_bufferimport list.Are these changes tested?
Covered by the existing
arrow-casttests — this is a code move, so no newtests are warranted and no existing test was modified.
As with the sibling PRs, the faithfulness of the move is checked mechanically
rather than by eye: extracting the two original line ranges from
HEADandnormalising away the added
pub(crate)gives a byte-identical match againstthe 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_binaryout of the numeric neighbourhood, the uniform
pub(crate), and the three droppedimports — are listed above because they are the parts a "pure move" diff would
not otherwise draw attention to.