From fbb7658e6a99717b03dcd817d85dd8a2fe7cc56b Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:02:48 +0100 Subject: [PATCH] replace deprecated import_from_c with import_arrow_from_c --- pyo3-polars/src/ffi/to_py.rs | 2 +- pyo3-polars/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyo3-polars/src/ffi/to_py.rs b/pyo3-polars/src/ffi/to_py.rs index e6debf9..765d85e 100644 --- a/pyo3-polars/src/ffi/to_py.rs +++ b/pyo3-polars/src/ffi/to_py.rs @@ -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), )?; diff --git a/pyo3-polars/src/lib.rs b/pyo3-polars/src/lib.rs index f41f3cb..bea64c7 100644 --- a/pyo3-polars/src/lib.rs +++ b/pyo3-polars/src/lib.rs @@ -165,9 +165,9 @@ impl IntoPy 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() { @@ -182,7 +182,7 @@ impl IntoPy 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