Skip to content

Commit

Permalink
replace deprecated import_from_c with import_arrow_from_c
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jul 24, 2024
1 parent 7337014 commit fbb7658
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyo3-polars/src/ffi/to_py.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) fn to_py_array(
let array_ptr: *const ffi::ArrowArray = &*array;

let array = pyarrow.getattr("Array")?.call_method1(
"_import_from_c",
"_import_arrow_from_c",
(array_ptr as Py_uintptr_t, schema_ptr as Py_uintptr_t),
)?;

Expand Down
6 changes: 3 additions & 3 deletions pyo3-polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ impl IntoPy<PyObject> for PySeries {
fn into_py(self, py: Python<'_>) -> PyObject {
let polars = py.import_bound("polars").expect("polars not installed");
let s = polars.getattr("Series").unwrap();
match s.getattr("_import_from_c") {
match s.getattr("_import_arrow_from_c") {
// Go via polars
Ok(import_from_c) => {
Ok(import_arrow_from_c) => {
// Prepare pointers on the heap.
let mut chunk_ptrs = Vec::with_capacity(self.0.n_chunks());
for i in 0..self.0.n_chunks() {
Expand All @@ -182,7 +182,7 @@ impl IntoPy<PyObject> for PySeries {
chunk_ptrs.push((schema_ptr as Py_uintptr_t, array_ptr as Py_uintptr_t))
}
// Somehow we need to clone the Vec, because pyo3 doesn't accept a slice here.
let pyseries = import_from_c
let pyseries = import_arrow_from_c
.call1((self.0.name(), chunk_ptrs.clone()))
.unwrap();
// Deallocate boxes
Expand Down

0 comments on commit fbb7658

Please sign in to comment.