diff --git a/crates/polars-core/src/chunked_array/object/builder.rs b/crates/polars-core/src/chunked_array/object/builder.rs index 351cdc58a383b..7b45079aafeb3 100644 --- a/crates/polars-core/src/chunked_array/object/builder.rs +++ b/crates/polars-core/src/chunked_array/object/builder.rs @@ -145,6 +145,7 @@ where } /// Convert a Series of dtype object to an Arrow Array of FixedSizeBinary +#[cfg(feature = "algorithm_group_by")] pub(crate) fn object_series_to_arrow_array(s: &Series) -> ArrayRef { // The list builder knows how to create an arrow array // we simply piggy back on that code. diff --git a/crates/polars-core/src/series/implementations/object.rs b/crates/polars-core/src/series/implementations/object.rs index c58f37159d90a..6129cb39e654f 100644 --- a/crates/polars-core/src/series/implementations/object.rs +++ b/crates/polars-core/src/series/implementations/object.rs @@ -49,6 +49,8 @@ where fn _get_flags(&self) -> Settings { self.0.get_flags() } + + #[cfg(feature = "algorithm_group_by")] unsafe fn agg_list(&self, groups: &GroupsProxy) -> Series { self.0.agg_list(groups) } @@ -185,14 +187,17 @@ where ObjectChunked::has_validity(&self.0) } + #[cfg(feature = "algorithm_group_by")] fn unique(&self) -> PolarsResult { ChunkUnique::unique(&self.0).map(|ca| ca.into_series()) } + #[cfg(feature = "algorithm_group_by")] fn n_unique(&self) -> PolarsResult { ChunkUnique::n_unique(&self.0) } + #[cfg(feature = "algorithm_group_by")] fn arg_unique(&self) -> PolarsResult { ChunkUnique::arg_unique(&self.0) } diff --git a/crates/polars-core/src/series/into.rs b/crates/polars-core/src/series/into.rs index 9a8b03ed46905..48ad653e6363d 100644 --- a/crates/polars-core/src/series/into.rs +++ b/crates/polars-core/src/series/into.rs @@ -87,6 +87,7 @@ impl Series { #[cfg(feature = "dtype-time")] DataType::Time => cast(&*self.chunks()[chunk_idx], &DataType::Time.to_arrow()).unwrap(), #[cfg(feature = "object")] + #[cfg(feature = "algorithm_group_by")] DataType::Object(_) => { use crate::chunked_array::object::builder::object_series_to_arrow_array; if self.chunks().len() == 1 && chunk_idx == 0 {