Skip to content

Commit

Permalink
add rust test
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Dec 16, 2024
1 parent 560c6aa commit 96b180c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions crates/polars-core/src/series/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,25 @@ mod test {
let _ = ca.into_series();
}

#[test]
fn roundtrip_list_logical_20311() {
let list = ListChunked::from_chunk_iter(
PlSmallStr::from_static("a"),
[ListArray::new(
ArrowDataType::LargeList(Box::new(ArrowField::new(
PlSmallStr::from_static("item"),
ArrowDataType::Int32,
true,
))),
unsafe { Offsets::new_unchecked(vec![0, 1]) }.into(),
PrimitiveArray::new(ArrowDataType::Int32, vec![1i32].into(), None).to_boxed(),
None,
)],
);
let list = unsafe { list.from_physical_unchecked(DataType::Date) }.unwrap();
assert_eq!(list.dtype(), &DataType::List(Box::new(DataType::Date)));
}

#[test]
#[cfg(feature = "dtype-struct")]
fn new_series_from_empty_structs() {
Expand Down

0 comments on commit 96b180c

Please sign in to comment.