From 9ceeddecfa46fa0b9bf8b49db6da0a8cd78ea1be Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Fri, 15 Nov 2024 17:33:52 +0100 Subject: [PATCH] fix: Fix object chunked gather (#19811) --- crates/polars-core/src/series/implementations/object.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/polars-core/src/series/implementations/object.rs b/crates/polars-core/src/series/implementations/object.rs index 5ef70ed8c99c..febc6445b860 100644 --- a/crates/polars-core/src/series/implementations/object.rs +++ b/crates/polars-core/src/series/implementations/object.rs @@ -132,11 +132,13 @@ where } fn take(&self, indices: &IdxCa) -> PolarsResult { - Ok(self.0.take(indices)?.into_series()) + let ca = self.rechunk_object(); + Ok(ca.take(indices)?.into_series()) } unsafe fn take_unchecked(&self, indices: &IdxCa) -> Series { - self.0.take_unchecked(indices).into_series() + let ca = self.rechunk_object(); + ca.take_unchecked(indices).into_series() } fn take_slice(&self, indices: &[IdxSize]) -> PolarsResult {