This is an automated email from the ASF dual-hosted git repository.
wjones127 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 89310b1a72 fix: correct array length validation error message (#7313)
89310b1a72 is described below
commit 89310b1a7200759e488ed7a90b434c16d7ca70f0
Author: Wyatt Alt <[email protected]>
AuthorDate: Wed Mar 19 09:44:01 2025 -0700
fix: correct array length validation error message (#7313)
Prior to this commit, the validate_child_data method of the ArrayData
implementation would return an incorrect error message for validation
failures on FixedSizeLists.
---
arrow-data/src/data.rs | 2 +-
arrow/tests/array_validation.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arrow-data/src/data.rs b/arrow-data/src/data.rs
index a76e00e267..10b954777d 100644
--- a/arrow-data/src/data.rs
+++ b/arrow-data/src/data.rs
@@ -1016,7 +1016,7 @@ impl ArrayData {
if values_data.len < expected_values_len {
return Err(ArrowError::InvalidArgumentError(format!(
"Values length {} is less than the length ({})
multiplied by the value size ({}) for {}",
- values_data.len, list_size, list_size, self.data_type
+ values_data.len, self.len, list_size, self.data_type
)));
}
diff --git a/arrow/tests/array_validation.rs b/arrow/tests/array_validation.rs
index 1321f10f94..62cda6b8ec 100644
--- a/arrow/tests/array_validation.rs
+++ b/arrow/tests/array_validation.rs
@@ -432,7 +432,7 @@ fn test_validate_large_list_view_negative_sizes() {
#[test]
#[should_panic(
- expected = "Values length 4 is less than the length (2) multiplied by the
value size (2) for FixedSizeList"
+ expected = "Values length 4 is less than the length (3) multiplied by the
value size (2) for FixedSizeList"
)]
fn test_validate_fixed_size_list() {
// child has 4 elements,