`binary_mut` and `try_binary_mut` return `Ok` for an empty array whose buffer is shared
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #12012 @abhinav-phi による — マージされずにクローズ
評価
調査の方向性
Read arrow-arith/src/arity.rs around binary_mut and try_binary_mut, then compare their empty-array early returns with into_builder in arrow-array/src/array/primitive_array.rs and the unary helpers. First resolve which shared-buffer behavior the binary forms should follow; done means their behavior and rustdoc agree, with regression coverage for the empty shared-buffer case.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The rustdoc of binary_mut says that if the buffer of a is shared, it returns Err(self), and try_binary_mut refers to it for buffer reuse. For an empty a, both return Ok(Ok(empty array)) even when the buffer is shared, because they return early before into_builder (the same in try_binary_mut). unary_mut and try_unary_mut call into_builder first, so they return Err(self) for the same input.
No buffer is changed, so this is a difference between the documentation and the behavior, and between the unary and binary forms.
To Reproduce
On main at 9ffd63d528:
use arrow::array::Int32Array;
use arrow::compute::{binary_mut, try_binary_mut, try_unary_mut, unary_mut};
let a = Int32Array::from(Vec::<i32>::new());
let b = Int32Array::from(Vec::<i32>::new());
// Err(self): the buffer is shared with `a`
assert!(unary_mut(a.clone(), |x| x + 1).is_err());
assert!(try_unary_mut(a.clone(), |x| Ok(x + 1)).is_err());
// Ok(Ok(empty)) instead of Err(self)
assert!(matches!(binary_mut(a.clone(), &b, |x, y| x + y), Ok(Ok(_))));
assert!(matches!(try_binary_mut(a.clone(), &b, |x, y| Ok(x + y)), Ok(Ok(_))));
Expected behavior
Should the binary forms return Err(self) for a shared buffer whatever its length, as the rustdoc says and the unary forms do? Or should all four return Ok for an empty array, and the rustdoc say so?
Additional context
Found by a property test of the arity helpers.
- 主要言語
- Rust
- スター
- 3.7k
- フォーク
- 1.5k
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 183
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/arrow-rs のほかの issue
-
parquet: `ArrowWriter::try_new` panics on a schema with a Union field instead of returning an errorオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
`RunArray::try_new` rejects run ends whose null buffer has no nulls対応中かも @Surajsuthar が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/arrow-rs#12427 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Variant] `variant_get` string and binary cast errors show Rust builder type names再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
メンテナーはふだん 1 日以内に返信
apache/arrow-rs の issue をすべて見る
似ている issue
-
area:ui effort:medium enhancement P7 source:agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
machine rename accepts a label already used by another machine, making --machine <label> ambiguousオープンmaintainer-needed p2 remote triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug help wanted ui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
userFRM/egui-charts#4605 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信