You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "quantumish (via GitHub)" <gi...@apache.org> on 2026/05/25 23:02:36 UTC
[I] `FixedSizeBinaryArray` implements `From>` etc despite conversion being fallible [arrow-rs]
quantumish opened a new issue, #10018:
URL: https://github.com/apache/arrow-rs/issues/10018
**Describe the bug**
`arrow::array::FixedSizeBinaryArray` implements `From<Vec<&[u8]>>`, `From<Vec<&[u8; N]>>`, and `From<Vec<Option<&[u8]>>>`. Each of these implementations panics when given inputs that cannot truly be converted to a `FixedSizeBinaryArray`.
From the Rust docs for `From`:
> Note: This trait must not fail. The From trait is intended for perfect conversions. If the conversion can fail or is not perfect, use [TryFrom](https://doc.rust-lang.org/std/convert/trait.TryFrom.html).
**To Reproduce**
```rs
use arrow_array::FixedSizeBinaryArray;
fn main() {
// Slices of different sizes: panics!
let a1 = FixedSizeBinaryArray::from(vec![[1].as_slice(), [1, 2].as_slice()]);
let a2 = FixedSizeBinaryArray::from(vec![Some([1].as_slice()), Some([1,2].as_slice())]);
// Slice of too large a size: panics! (admittedly a corner case)
let arr = vec![0; i32::MAX as usize + 1];
let slice = <&[u8; i32::MAX as usize + 1]>::try_from(arr.as_slice()).unwrap();
let a3 = FixedSizeBinaryArray::from(vec![slice]);
dbg!(a1, a2, a3);
}
```
**Expected behavior**
The presence of `From` implementations implies that an infallible conversion is possible, so it's expected that these calls would produce some valid `FixedBinarySizeArray` (whether that could be done in a coherent fashion is unlikely - realistically these should be `TryFrom` implementations).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] `FixedSizeBinaryArray` implements `From>` etc despite conversion being fallible [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #10018:
URL: https://github.com/apache/arrow-rs/issues/10018#issuecomment-4616731395
`label_issue.py` automatically added labels {'parquet'} from #10019
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] `FixedSizeBinaryArray` implements `From>` etc despite conversion being fallible [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #10018:
URL: https://github.com/apache/arrow-rs/issues/10018#issuecomment-4616731844
`label_issue.py` automatically added labels {'arrow'} from #10019
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] `FixedSizeBinaryArray` implements `From>` etc despite conversion being fallible [arrow-rs]
Posted by "quantumish (via GitHub)" <gi...@apache.org>.
quantumish commented on issue #10018:
URL: https://github.com/apache/arrow-rs/issues/10018#issuecomment-4537835894
take
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] `FixedSizeBinaryArray` implements `From>` etc despite conversion being fallible [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #10018: `FixedSizeBinaryArray` implements `From<Vec<&[u8]>>` etc despite conversion being fallible
URL: https://github.com/apache/arrow-rs/issues/10018
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org