Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace deprecated import_from_c with import_arrow_from_c #89

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading