Skip to content

Commit

Permalink
object
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 26, 2023
1 parent 26ac4fa commit 89f9fc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/polars-core/src/chunked_array/object/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions crates/polars-core/src/series/implementations/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -185,14 +187,17 @@ where
ObjectChunked::has_validity(&self.0)
}

#[cfg(feature = "algorithm_group_by")]
fn unique(&self) -> PolarsResult<Series> {
ChunkUnique::unique(&self.0).map(|ca| ca.into_series())
}

#[cfg(feature = "algorithm_group_by")]
fn n_unique(&self) -> PolarsResult<usize> {
ChunkUnique::n_unique(&self.0)
}

#[cfg(feature = "algorithm_group_by")]
fn arg_unique(&self) -> PolarsResult<IdxCa> {
ChunkUnique::arg_unique(&self.0)
}
Expand Down
1 change: 1 addition & 0 deletions crates/polars-core/src/series/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 89f9fc2

Please sign in to comment.