Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added panic message to docs. #5857

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Conversation

SeeRightThroughMe
Copy link
Contributor

Which issue does this PR close?

N/A

Rationale for this change

Schema::field does not indicate that it panics in the current docs. It does panic though (not that this is particularly surprising!).

Here's an example that will panic:

use arrow::datatypes::SchemaBuilder;
fn main() {
    let mut builder = SchemaBuilder::new();
    let schema = builder.finish();
    let my_field = schema.field(2); // <-- Panics here because index OOB. 
}

What changes are included in this PR?

Just a docstring.

Are there any user-facing changes?

Nope, but perhaps in future, field should either return a result, or we add a try_field function that returns a result (to prevent people needing to change code relying on Schema::field already)

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 8, 2024
@SeeRightThroughMe
Copy link
Contributor Author

(also, I know it's a tiny change but this is my first contribution on any open-source project ever! 😄 )

Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @SeeRightThroughMe. Congrats on your first contribution 😄

@alamb alamb merged commit 76d04a8 into apache:master Jun 10, 2024
25 checks passed
@alamb
Copy link
Contributor

alamb commented Jun 10, 2024

Thanks @paddyhoran and @SeeRightThroughMe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants