alamb commented on code in PR #10155:
URL: https://github.com/apache/arrow-rs/pull/10155#discussion_r3438534847
##########
arrow-pyarrow/src/lib.rs:
##########
@@ -321,18 +321,20 @@ impl ToPyArrow for ArrayData {
impl<T: FromPyArrow> FromPyArrow for Vec<T> {
fn from_pyarrow_bound(value: &Bound<PyAny>) -> PyResult<Self> {
- let list = value.cast::<PyList>()?;
- list.iter().map(|x| T::from_pyarrow_bound(&x)).collect()
+ let mut v = Vec::with_capacity(value.len().unwrap_or(0));
Review Comment:
Why not keep the `collect` syntax?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]