Skip to content

Commit 1a6e6b9

Browse files
build(rust): Bump up numpy and pyo3 to 0.28 (#26743)
1 parent c5825d6 commit 1a6e6b9

18 files changed

Lines changed: 38 additions & 65 deletions

File tree

Cargo.lock

Lines changed: 12 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ ndarray = { version = "0.17", default-features = false }
7171
num-bigint = "0.4.6"
7272
num-derive = "0.4.2"
7373
num-traits = "0.2"
74-
numpy = "0.27"
74+
numpy = "0.28"
7575
object_store = { version = "0.13.1", default-features = false, features = ["fs"] }
7676
parking_lot = "0.12"
7777
percent-encoding = "2.3"
7878
pin-project-lite = "0.2"
7979
proptest = { version = "1.6", default-features = false, features = ["std"] }
80-
pyo3 = "0.27"
80+
pyo3 = "0.28"
8181
rand = "0.9"
8282
rand_distr = "0.5"
8383
raw-cpuid = "11"

crates/polars-python/src/conversion/categorical.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::sync::Arc;
33
use polars_dtype::categorical::{CatSize, Categories};
44
use pyo3::{pyclass, pymethods};
55

6-
#[pyclass(frozen)]
6+
#[pyclass(frozen, from_py_object)]
77
#[repr(transparent)]
88
#[derive(Clone)]
99
pub struct PyCategories {

crates/polars-python/src/dataframe/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use parking_lot::RwLock;
1515
use polars::prelude::DataFrame;
1616
use pyo3::pyclass;
1717

18-
#[pyclass(frozen)]
18+
#[pyclass(frozen, from_py_object)]
1919
#[repr(transparent)]
2020
pub struct PyDataFrame {
2121
pub df: RwLock<DataFrame>,

crates/polars-python/src/expr/datatype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::selector::{PySelector, parse_datatype_selector};
66
use crate::error::PyPolarsErr;
77
use crate::prelude::Wrap;
88

9-
#[pyclass(frozen)]
9+
#[pyclass(frozen, from_py_object)]
1010
#[repr(transparent)]
1111
#[derive(Clone)]
1212
pub struct PyDataTypeExpr {

crates/polars-python/src/expr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::mem::ManuallyDrop;
3434
use polars::lazy::dsl::Expr;
3535
use pyo3::pyclass;
3636

37-
#[pyclass] // Not marked as frozen for pickling, but that's the only &mut self method.
37+
#[pyclass(from_py_object)] // Not marked as frozen for pickling, but that's the only &mut self method.
3838
#[repr(transparent)]
3939
#[derive(Clone)]
4040
pub struct PyExpr {

crates/polars-python/src/expr/selector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use pyo3::{PyResult, pyclass};
1010

1111
use crate::prelude::Wrap;
1212

13-
#[pyclass(frozen)]
13+
#[pyclass(frozen, from_py_object)]
1414
#[repr(transparent)]
1515
#[derive(Clone)]
1616
pub struct PySelector {

crates/polars-python/src/functions/whenthen.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ pub fn when(condition: PyExpr) -> PyWhen {
1010
}
1111
}
1212

13-
#[pyclass(frozen)]
13+
#[pyclass(frozen, skip_from_py_object)]
1414
#[derive(Clone)]
1515
pub struct PyWhen {
1616
inner: dsl::When,
1717
}
1818

19-
#[pyclass(frozen)]
19+
#[pyclass(frozen, skip_from_py_object)]
2020
#[derive(Clone)]
2121
pub struct PyThen {
2222
inner: dsl::Then,
2323
}
2424

25-
#[pyclass(frozen)]
25+
#[pyclass(frozen, skip_from_py_object)]
2626
#[derive(Clone)]
2727
pub struct PyChainedWhen {
2828
inner: dsl::ChainedWhen,
2929
}
3030

31-
#[pyclass(frozen)]
31+
#[pyclass(frozen, skip_from_py_object)]
3232
#[derive(Clone)]
3333
pub struct PyChainedThen {
3434
inner: dsl::ChainedThen,

crates/polars-python/src/interop/numpy/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ where
4646
std::mem::forget(owner);
4747
PY_ARRAY_API.PyArray_SetBaseObject(py, array as *mut PyArrayObject, owner_ptr);
4848

49-
Py::from_owned_ptr(py, array)
49+
Bound::from_owned_ptr(py, array).into()
5050
}
5151

5252
/// Returns whether the data type supports creating a NumPy view.

crates/polars-python/src/lazyframe/exitable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl PyLazyFrame {
1717
}
1818
}
1919

20-
#[pyclass(frozen)]
20+
#[pyclass(frozen, skip_from_py_object)]
2121
#[cfg(not(target_arch = "wasm32"))]
2222
#[repr(transparent)]
2323
#[derive(Clone)]

0 commit comments

Comments
 (0)