Skip to content

Return PyValueError for nullable PyArrow struct imports#10174

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix-pyarrow-nullable-struct-error
Open

Return PyValueError for nullable PyArrow struct imports#10174
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix-pyarrow-nullable-struct-error

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What changed

RecordBatch::from_pyarrow_bound now returns a PyValueError when a PyArrow C array capsule contains a nullable top-level StructArray, instead of panicking via an internal assertion.

A regression test covers importing a nullable PyArrow struct array through the capsule path.

Why

This conversion handles external Python input, so unsupported nullable struct arrays should surface as Python exceptions rather than aborting through a Rust panic.

Validation

  • cargo fmt --package arrow-pyarrow
  • cargo fmt --manifest-path arrow-pyarrow-testing/Cargo.toml
  • cargo test --manifest-path arrow-pyarrow-testing/Cargo.toml test_from_pyarrow_nullable_struct_array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant