Skip to content

Commit 13fc3c8

Browse files
authored
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.
1 parent 9482f78 commit 13fc3c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arrow-array/src/array/struct_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl StructArray {
108108
arrays: Vec<ArrayRef>,
109109
nulls: Option<NullBuffer>,
110110
) -> Result<Self, ArrowError> {
111-
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()))?;
111+
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()))?;
112112

113113
Self::try_new_with_length(fields, arrays, nulls, len)
114114
}

0 commit comments

Comments
 (0)