apache / apache/arrow-rs

Proposal: all panicky functions should have a try_ version

Open
#10,553 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 18h
Merged PRs (30d)
169

Description

There are a lot of functions in arrow that are "panic by default" - that is, a bad argument causes a panic.

I want to propose that we try to heed this design going forward:

* Every function that can panic on bad input should have a `# Panics` section in its docstring (we mostly do this already)
* Every function that can panic on bad input should have a `try_` version of itself that instead returns a `Result`

## Related
* https://github.com/apache/arrow-rs/issues/6737
* https://github.com/apache/arrow-rs/pull/6958
* https://github.com/apache/arrow-rs/issues/9843

Contributor guide

Open the contributing guide

Research direction

Start by reviewing related issue 6737 and pull request 6958, then survey Arrow functions that can panic on bad input. Define the scope of the proposal before identifying the affected APIs. Done means the agreed functions document their panics and have corresponding try_ versions returning Result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.