Skip to content

Commit

Permalink
fix: nested dtypes: export logical type in plugins (#13325)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Dec 30, 2023
1 parent ec8c9e0 commit 71257c1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/polars-ffi/src/version_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ unsafe extern "C" fn c_release_series_export(e: *mut SeriesExport) {
pub fn export_series(s: &Series) -> SeriesExport {
let field = ArrowField::new(s.name(), s.dtype().to_arrow(), true);
let schema = Box::new(ffi::export_field_to_c(&field));
let mut arrays = s
.chunks()
.iter()
.map(|arr| Box::into_raw(Box::new(ffi::export_array_to_c(arr.clone()))))

let mut arrays = (0..s.chunks().len())
.map(|i| {
// Make sure we export the logical type.
let arr = s.to_arrow(i);
Box::into_raw(Box::new(ffi::export_array_to_c(arr.clone())))
})
.collect::<Box<_>>();

let len = arrays.len();
let ptr = arrays.as_mut_ptr();
SeriesExport {
Expand Down

0 comments on commit 71257c1

Please sign in to comment.