From 1faf932cfdb80777fff398e3db3be1ea3220998f Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Mon, 15 Apr 2024 15:25:02 +0200 Subject: [PATCH] fix: Panic if invalid array in object (#15664) --- crates/polars-core/src/chunked_array/ops/any_value.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/polars-core/src/chunked_array/ops/any_value.rs b/crates/polars-core/src/chunked_array/ops/any_value.rs index 7182bcacb01a..1fc0ab6f12e2 100644 --- a/crates/polars-core/src/chunked_array/ops/any_value.rs +++ b/crates/polars-core/src/chunked_array/ops/any_value.rs @@ -121,7 +121,7 @@ pub(crate) unsafe fn arr_to_any_value<'a>( DataType::Object(_, _) => { // We should almost never hit this. The only known exception is when we put objects in // structs. Any other hit should be considered a bug. - let arr = &*(arr as *const dyn Array as *const FixedSizeBinaryArray); + let arr = arr.as_any().downcast_ref::().unwrap(); PolarsExtension::arr_to_av(arr, idx) }, DataType::Null => AnyValue::Null,