Repository navigation
Conversation
Add `# Panics` sections to public functions that can panic, in preparation for enabling the `clippy::missing_panics_doc` lint. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The `#[expect]` reason claimed that `write` always flushes, so `into_inner` could not fail. That only holds on the success path: `write` flushes at the very end, so a `write` that returned an error leaves rows buffered, and the flush inside `into_inner` can then fail and panic. `into_inner` returns `W`, so there is nowhere to report that. Document it instead of asserting it cannot happen. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A doc comment placed after `#[inline]`, `#[deprecated]` or `#[proc_macro_derive]` still renders, but it splits the doc block in two and reads as if the attribute belongs to the section. Move the new `# Panics` sections above the attribute, where the rest of the docs are. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Two of the documented panics are deliberate, and the docs now say so rather than leaving the reader to wonder why the function does not report the failure: * `try_for_each_valid_idx` takes the caller's error type, so it has no error value to build * the `arrow-integration-test` JSON readers parse fixtures, where malformed input is a broken test rather than bad data Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
emilk
force-pushed
the
emilk/panics-docs
branch
from
August 19, 2026 19:29
683d113 to
7939894
Compare
This was referenced Aug 19, 2026
`MutableArrayData::try_with_capacities` arrived with apache#10675. It only turns the dictionary key overflow into an error, and still panics for the other cases, so say so under a heading the lint recognises. Co-Authored-By: Claude Opus 5 <[email protected]>
Jefffrey
pushed a commit
that referenced
this pull request
Aug 29, 2026
…e `unwrap`s (#10759) # Which issue does this PR close? - Part of #10553 # Rationale for this change This is one of four PRs splitting up the `clippy::missing_panics_doc` work. 1. #10755 - return errors from fallible functions 2. #10759 - remove unreachable panics 3. #10760 - document the panics that genuinely remain 4. #10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Replaces `unwrap`/`expect` calls that cannot fail with non-panicking equivalents. # Are these changes tested? Covered by the existing tests. Every change here is a rewrite of code whose panic was unreachable, so there is no new behavior to test. # Are there any user-facing changes? Yes - `OffsetBuffer::last/first` no longer returns `Option` --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Jefffrey
added a commit
that referenced
this pull request
Sep 1, 2026
# Which issue does this PR close? - Part of #10553 # Rationale for this change While clearing `clippy::missing_panics_doc`, a pattern turned up: functions that already return `Result`, but report some failures by panicking. Several are reachable from untrusted input, so the panic is a denial of service rather than a bug report. Documenting those panics would normalise them, so this returns errors instead. This is one of four PRs splitting up the work. 1. **this PR** - return errors from fallible functions 2. #10759 - remove unreachable panics 3. #10760 - document the panics that genuinely remain 4. #10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Functions that could report the failure and did not. # Are these changes tested? Covered by the existing tests, plus new tests for the `b64_decode` and `ArrayData::validate_values` error paths. # Are there any user-facing changes? No API changes. Some calls that used to panic now return an `Err`, which is the point of the PR. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Jeffrey Vo <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 2, 2026
…e `unwrap`s (apache#10759) # Which issue does this PR close? - Part of apache#10553 # Rationale for this change This is one of four PRs splitting up the `clippy::missing_panics_doc` work. 1. apache#10755 - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Replaces `unwrap`/`expect` calls that cannot fail with non-panicking equivalents. # Are these changes tested? Covered by the existing tests. Every change here is a rewrite of code whose panic was unreachable, so there is no new behavior to test. # Are there any user-facing changes? Yes - `OffsetBuffer::last/first` no longer returns `Option` --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 18, 2026
…e `unwrap`s (apache#10759) # Which issue does this PR close? - Part of apache#10553 # Rationale for this change This is one of four PRs splitting up the `clippy::missing_panics_doc` work. 1. apache#10755 - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Replaces `unwrap`/`expect` calls that cannot fail with non-panicking equivalents. # Are these changes tested? Covered by the existing tests. Every change here is a rewrite of code whose panic was unreachable, so there is no new behavior to test. # Are there any user-facing changes? Yes - `OffsetBuffer::last/first` no longer returns `Option` --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 18, 2026
# Which issue does this PR close? - Part of apache#10553 # Rationale for this change While clearing `clippy::missing_panics_doc`, a pattern turned up: functions that already return `Result`, but report some failures by panicking. Several are reachable from untrusted input, so the panic is a denial of service rather than a bug report. Documenting those panics would normalise them, so this returns errors instead. This is one of four PRs splitting up the work. 1. **this PR** - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Functions that could report the failure and did not. # Are these changes tested? Covered by the existing tests, plus new tests for the `b64_decode` and `ArrayData::validate_values` error paths. # Are there any user-facing changes? No API changes. Some calls that used to panic now return an `Err`, which is the point of the PR. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Jeffrey Vo <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 21, 2026
…e `unwrap`s (apache#10759) # Which issue does this PR close? - Part of apache#10553 # Rationale for this change This is one of four PRs splitting up the `clippy::missing_panics_doc` work. 1. apache#10755 - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Replaces `unwrap`/`expect` calls that cannot fail with non-panicking equivalents. # Are these changes tested? Covered by the existing tests. Every change here is a rewrite of code whose panic was unreachable, so there is no new behavior to test. # Are there any user-facing changes? Yes - `OffsetBuffer::last/first` no longer returns `Option` --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 21, 2026
# Which issue does this PR close? - Part of apache#10553 # Rationale for this change While clearing `clippy::missing_panics_doc`, a pattern turned up: functions that already return `Result`, but report some failures by panicking. Several are reachable from untrusted input, so the panic is a denial of service rather than a bug report. Documenting those panics would normalise them, so this returns errors instead. This is one of four PRs splitting up the work. 1. **this PR** - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Functions that could report the failure and did not. # Are these changes tested? Covered by the existing tests, plus new tests for the `b64_decode` and `ArrayData::validate_values` error paths. # Are there any user-facing changes? No API changes. Some calls that used to panic now return an `Err`, which is the point of the PR. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Jeffrey Vo <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 25, 2026
…e `unwrap`s (apache#10759) # Which issue does this PR close? - Part of apache#10553 # Rationale for this change This is one of four PRs splitting up the `clippy::missing_panics_doc` work. 1. apache#10755 - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Replaces `unwrap`/`expect` calls that cannot fail with non-panicking equivalents. # Are these changes tested? Covered by the existing tests. Every change here is a rewrite of code whose panic was unreachable, so there is no new behavior to test. # Are there any user-facing changes? Yes - `OffsetBuffer::last/first` no longer returns `Option` --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 25, 2026
# Which issue does this PR close? - Part of apache#10553 # Rationale for this change While clearing `clippy::missing_panics_doc`, a pattern turned up: functions that already return `Result`, but report some failures by panicking. Several are reachable from untrusted input, so the panic is a denial of service rather than a bug report. Documenting those panics would normalise them, so this returns errors instead. This is one of four PRs splitting up the work. 1. **this PR** - return errors from fallible functions 2. apache#10759 - remove unreachable panics 3. apache#10760 - document the panics that genuinely remain 4. apache#10761 - `#[expect]` the unreachable ones, so the lint can be turned on # What changes are included in this PR? Functions that could report the failure and did not. # Are these changes tested? Covered by the existing tests, plus new tests for the `b64_decode` and `ArrayData::validate_values` error paths. # Are there any user-facing changes? No API changes. Some calls that used to panic now return an `Err`, which is the point of the PR. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Jeffrey Vo <[email protected]>
|
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days. |
# Conflicts: # arrow-buffer/src/util/bit_chunk_iterator.rs
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
This is one of four PRs splitting up the
clippy::missing_panics_docwork.Each one stands on its own and touches its own set of functions, but they are
meant to land in order, since the later ones assume the earlier ones:
OffsetBuffer::first/lastto always return offset & remove someunwraps #10759 - remove unreachable panics#[expect(clippy::missing_panics_doc)]#10761 -#[expect]the unreachable ones, so the lint can be turned onWhat is left after the first two PRs is panics that are real and that the
function cannot report any other way. Those get a
# Panicssection.What changes are included in this PR?
# Panicssections on the public functions that can still panic, includingthe ones that only panic under the
force_validatefeaturewonder:
try_for_each_valid_idxtakes the caller's error type and so has noerror value to build, and the
arrow-integration-testJSON readers parsefixtures, where malformed input is a broken test rather than bad data
arrow-csv'sWriter::into_innerdocuments its panic honestly. A successfulwriteflushes, but awritethat returned an error leaves rows buffered, andthe flush inside
into_innercan then fail. It returnsW, so there isnowhere to report that
arrow::util::test_utilandarrow::util::bench_utilare public, so theirmodule docs say the helpers panic on invalid input
# Panicssections go before#[inline],#[deprecated]and#[proc_macro_derive], rather than after, so the doc block stays in one piecePrimitiveDictionaryBuilderarrow-integration-testingis deliberately left undocumented: it ispublish = falseand holds only integration test binaries. #10761 suppresses thelint for that crate instead.
Are these changes tested?
Documentation only.
cargo doc --workspace --all-featuresis clean.Are there any user-facing changes?
Documentation only.