From 30635d87a37d521dd88e1a7713def6c5ba27634c Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 4 Jun 2024 08:09:03 +0200 Subject: [PATCH] Fix debug assert --- crates/polars-core/src/chunked_array/from.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/polars-core/src/chunked_array/from.rs b/crates/polars-core/src/chunked_array/from.rs index f6cd87614dfc..210a09966ef4 100644 --- a/crates/polars-core/src/chunked_array/from.rs +++ b/crates/polars-core/src/chunked_array/from.rs @@ -206,11 +206,8 @@ where // that check if the data types in the arrays are as expected #[cfg(debug_assertions)] { - if !chunks.is_empty() && dtype.is_primitive() { - assert_eq!( - chunks[0].data_type().underlying_physical_type(), - dtype.to_arrow(true) - ) + if !chunks.is_empty() && !chunks[0].is_empty() && dtype.is_primitive() { + assert_eq!(chunks[0].data_type(), &dtype.to_arrow(true)) } } let field = Arc::new(Field::new(name, dtype));