feat(arrow-buffer): add OutOfBoundsError and fallible Buffer slicing - #10737
Draft
emilk wants to merge 4 commits into
Draft
feat(arrow-buffer): add OutOfBoundsError and fallible Buffer slicing#10737emilk wants to merge 4 commits into
OutOfBoundsError and fallible Buffer slicing#10737emilk wants to merge 4 commits into
Conversation
`Buffer::slice`, `advance` and `slice_with_length` panic when asked for a range they do not hold. Add `OutOfBoundsError` and a `try_` variant for each: * `Buffer::try_slice` * `Buffer::try_advance` (leaves the buffer unchanged on failure) * `Buffer::try_slice_with_length` The panicking versions delegate to the fallible ones and keep their existing panic messages, which several crates assert on in tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
emilk
force-pushed
the
emilk/out-of-bounds-error
branch
from
September 2, 2026 12:20
074c53c to
d3fb663
Compare
emilk
commented
Sep 2, 2026
| bench = false | ||
|
|
||
| [dependencies] | ||
| arrow-buffer = { workspace = true } |
Contributor
Author
There was a problem hiding this comment.
This is so that ArrowError can wrap the errors in arrow-buffer, but maybe the dependency should point the other way, and all error types live in arrow-schema? Either way we add a new dependency to something
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?
Rationale for this change
Adds fallible buffer and scalar-buffer construction without changing existing panicking APIs.
What changes are included in this PR?
enum BufferErrortoarrow-bufferOutOfBoundsErrortoarrow-bufferBufferslicing and advancingScalarBuffer::try_newBufferErrortoArrowErrorAre these changes tested?
Library clippy passes for
arrow-bufferandarrow-schema.Are there any user-facing changes?
New public APIs only, no breaking changes.