This is an automated email from the ASF dual-hosted git repository.
xudong963 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 13fc3c8ef1 Fix the error info of `StructArray::try_new` (#7634)
13fc3c8ef1 is described below
commit 13fc3c8ef15e39d80ad005565d3054d9cc2a366e
Author: xudong.w <[email protected]>
AuthorDate: Tue Jun 10 23:17:31 2025 +0800
Fix the error info of `StructArray::try_new` (#7634)
# Rationale for this change
There isn't `StructArray::new_empty`, it's
`StructArray::new_empty_fields`, the error info is misleading.
---
arrow-array/src/array/struct_array.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arrow-array/src/array/struct_array.rs
b/arrow-array/src/array/struct_array.rs
index e6d12a5ad5..fbc34ef0c8 100644
--- a/arrow-array/src/array/struct_array.rs
+++ b/arrow-array/src/array/struct_array.rs
@@ -108,7 +108,7 @@ impl StructArray {
arrays: Vec<ArrayRef>,
nulls: Option<NullBuffer>,
) -> Result<Self, ArrowError> {
- let len = arrays.first().map(|x|
x.len()).ok_or_else(||ArrowError::InvalidArgumentError("use
StructArray::try_new_with_length or StructArray::new_empty to create a struct
array with no fields so that the length can be set correctly".to_string()))?;
+ let len = arrays.first().map(|x|
x.len()).ok_or_else(||ArrowError::InvalidArgumentError("use
StructArray::try_new_with_length or StructArray::new_empty_fields to create a
struct array with no fields so that the length can be set
correctly".to_string()))?;
Self::try_new_with_length(fields, arrays, nulls, len)
}