From 26d73750a7667bea40b6cb4ea4c38fa9b582d1aa Mon Sep 17 00:00:00 2001 From: ritchie Date: Thu, 9 Jan 2025 16:24:31 +0100 Subject: [PATCH] fix: Don't panic but set null type if type is unknown --- crates/polars-core/src/series/ops/null.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/polars-core/src/series/ops/null.rs b/crates/polars-core/src/series/ops/null.rs index b5b8b4ad6362..40ef6a383dd6 100644 --- a/crates/polars-core/src/series/ops/null.rs +++ b/crates/polars-core/src/series/ops/null.rs @@ -89,7 +89,7 @@ impl Series { }, DataType::Null => Series::new_null(name, size), DataType::Unknown(kind) => { - let dtype = kind.materialize().expect("expected known type"); + let dtype = kind.materialize().unwrap_or(DataType::Null); Series::full_null(name, size, &dtype) }, #[cfg(feature = "object")]