Skip to content

Commit

Permalink
Add test for fixed binary array
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Apr 12, 2022
1 parent d0f3a5e commit d41c57c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arrow/src/array/array_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,8 @@ mod tests {

use crate::{
array::{DecimalBuilder, LargeListArray, ListArray},
datatypes::{Field, Schema}, record_batch::RecordBatch,
datatypes::{Field, Schema},
record_batch::RecordBatch,
};

use super::*;
Expand Down Expand Up @@ -1743,6 +1744,10 @@ mod tests {
}

#[test]
// Test for https://github.com/apache/arrow-rs/issues/1390
#[should_panic(
expected = "column types must match schema types, expected FixedSizeBinary(2) but found FixedSizeBinary(0) at column index 0."
)]
fn fixed_size_binary_array_all_null_in_batch_with_schema() {
let schema =
Schema::new(vec![Field::new("a", DataType::FixedSizeBinary(2), false)]);
Expand All @@ -1751,7 +1756,7 @@ mod tests {
let item = FixedSizeBinaryArray::try_from_sparse_iter(
vec![none_option, none_option, none_option].into_iter(),
)
.unwrap();
.unwrap();

// Should not panic
RecordBatch::try_new(Arc::new(schema), vec![Arc::new(item)]).unwrap();
Expand Down

0 comments on commit d41c57c

Please sign in to comment.