Repository navigation
fix(arrow-arith): return Err for shared empty buffers in binary_mut - #12012
abhinav-phi wants to merge 1 commit into
Conversation
Remove the empty-array shortcuts so binary_mut and try_binary_mut use the same PrimitiveArray::into_builder buffer-sharing check as unary_mut and try_unary_mut. Add regression coverage for shared and unshared empty inputs.
|
@abhinav-phi can you enable the CI on your fork |
|
@Rich-T-kid enabled actions in the fork and started the CI run on the branch: https://github.com/abhinav-phi/arrow-rs/actions/runs/41263853321 i will keep an eye on it and fix anything that fails. |
|
Thank you for the contribution. The change may well be correct, but I am closing this PR under our guidance on AI-generated submissions. Maintainer review time is the scarcest resource in this project. This account has opened more than 30 PRs across many repositories in the last month, which looks like GitHub "merge-maxxing" (collecting merged PRs) rather than work on a project the author uses. Several similar PRs have been closed elsewhere (for example apache/datafusion-sqlparser-rs#2788, boa-dev/temporal#760, OSGeo/grass#8126, python/cpython#158491 and wagtail/wagtail#14670). That suggests the changes aren't coming from someone who uses arrow-rs, and that no human will be around to discuss review feedback and maintain the code. Reviewing PRs like this costs us more time than it saves. If you do use arrow-rs and this fix matters to you, please pick the one change you care most about. Then open a focused PR with a short description in your own words, one you have reviewed and understand, and we'd be happy to help with review. |
Which issue does this PR close?
binary_mutandtry_binary_mutreturnOkfor an empty array whose buffer is shared #12002Rationale for this change
binary_mutandtry_binary_mutshort-circuited empty input arrays and returnedOkwithout callinginto_builder, so an empty array with a shared buffer was reused even though the documented contract and the unary variants return the array back asErr. The issue reports the same inconsistency.What changes are included in this PR?
Remove the two undocumented
is_empty()shortcuts inarrow-arith/src/arity.rs. Empty arrays now go throughinto_builder, so a shared buffer returnsErr(self)and an unshared empty buffer still returnsOk.An empty array with a shared buffer now returns
Err(self)instead ofOk(Ok(empty)); this is the user-visible behaviour discussed in the issue and may warrant theapi-changelabel.Are these changes tested?
Added
test_binary_mut_empty_shared_buffercovering both functions with shared and unshared empty inputs.cargo test -p arrow-arith test_binary_mut_empty_shared_bufferpasses.cargo test -p arrow-arith-> 258 unit tests and 16 doc tests pass.cargo fmt --all -- --checkclean.cargo clippy --workspace --all-targets --all-features -- -D warningsclean.AI assistance: yes. The change was reviewed and tested by the submitter.