Skip to content

Commit

Permalink
Update existing test
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Nov 22, 2023
1 parent 9c8aff3 commit 25225bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions arrow-array/src/builder/struct_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,18 @@ mod tests {

#[test]
#[should_panic(
expected = "Data type List(Field { name: \"item\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) is not currently supported"
expected = "Data type Map(Field { name: \"entries\", data_type: Struct([Field { name: \"keys\", data_type: Int32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"values\", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, false) is not currently supported"
)]
fn test_struct_array_builder_from_schema_unsupported_type() {
let list_type = DataType::List(Arc::new(Field::new("item", DataType::Int64, true)));
let keys = Arc::new(Field::new("keys", DataType::Int32, false));
let values = Arc::new(Field::new("values", DataType::UInt32, false));
let struct_type = DataType::Struct(Fields::from(vec![keys, values]));
let map_data_type =
DataType::Map(Arc::new(Field::new("entries", struct_type, false)), false);

let fields = vec![
Field::new("f1", DataType::Int16, false),
Field::new("f2", list_type, false),
Field::new("f2", map_data_type, false),
];

let _ = StructBuilder::from_fields(fields, 5);
Expand Down

0 comments on commit 25225bf

Please sign in to comment.