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

build: Revert PyO3 version back to 0.21 #19376

Merged
merged 3 commits into from
Oct 23, 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
31 changes: 15 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ memmap = { package = "memmap2", version = "0.7" }
multiversion = "0.7"
ndarray = { version = "0.15", default-features = false }
num-traits = "0.2"
numpy = "0.22"
object_store = { version = "0.10", default-features = false }
once_cell = "1"
parking_lot = "0.12"
percent-encoding = "2.3"
pin-project-lite = "0.2"
pyo3 = "0.22"
pyo3 = "0.21"
rand = "0.8"
rand_distr = "0.4"
raw-cpuid = "11"
Expand Down
4 changes: 3 additions & 1 deletion crates/polars-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ itoa = { workspace = true }
libc = { workspace = true }
ndarray = { workspace = true }
num-traits = { workspace = true }
numpy = { workspace = true }
# TODO: Pin to released version once NumPy 2.0 support is merged
# https://github.com/PyO3/rust-numpy/issues/409
numpy = { git = "https://github.com/stinodego/rust-numpy.git", rev = "9ba9962ae57ba26e35babdce6f179edf5fe5b9c8", default-features = false }
once_cell = { workspace = true }
pyo3 = { workspace = true, features = ["abi3-py39", "chrono", "multiple-pymethods"] }
recursive = { workspace = true }
Expand Down
10 changes: 1 addition & 9 deletions crates/polars-python/src/conversion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,20 +604,12 @@ impl IntoPy<PyObject> for Wrap<&Schema> {
}
}

#[derive(Debug)]
#[derive(Clone, Debug)]
#[repr(transparent)]
pub struct ObjectValue {
pub inner: PyObject,
}

impl Clone for ObjectValue {
fn clone(&self) -> Self {
Python::with_gil(|py| Self {
inner: self.inner.clone_ref(py),
})
}
}

impl Hash for ObjectValue {
fn hash<H: Hasher>(&self, state: &mut H) {
let h = Python::with_gil(|py| self.inner.bind(py).hash().expect("should be hashable"));
Expand Down
9 changes: 1 addition & 8 deletions crates/polars-python/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ use pyo3::types::{PyBytes, PyString, PyStringMethods};
use crate::error::PyPolarsErr;
use crate::prelude::resolve_homedir;

#[derive(Clone)]
pub struct PyFileLikeObject {
inner: PyObject,
}

impl Clone for PyFileLikeObject {
fn clone(&self) -> Self {
Python::with_gil(|py| Self {
inner: self.inner.clone_ref(py),
})
}
}

/// Wraps a `PyObject`, and implements read, seek, and write for it.
impl PyFileLikeObject {
/// Creates an instance of a `PyFileLikeObject` from a `PyObject`.
Expand Down
16 changes: 8 additions & 8 deletions crates/polars-python/src/lazyframe/visitor/expr_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ impl IntoPy<PyObject> for Wrap<ClosedInterval> {
}
}

#[pyclass(name = "Operator", eq)]
#[derive(Copy, Clone, PartialEq)]
#[pyclass(name = "Operator")]
#[derive(Copy, Clone)]
pub enum PyOperator {
Eq,
EqValidity,
Expand Down Expand Up @@ -129,8 +129,8 @@ impl IntoPy<PyObject> for Wrap<InequalityOperator> {
}
}

#[pyclass(name = "StringFunction", eq)]
#[derive(Copy, Clone, PartialEq)]
#[pyclass(name = "StringFunction")]
#[derive(Copy, Clone)]
pub enum PyStringFunction {
ConcatHorizontal,
ConcatVertical,
Expand Down Expand Up @@ -183,8 +183,8 @@ impl PyStringFunction {
}
}

#[pyclass(name = "BooleanFunction", eq)]
#[derive(Copy, Clone, PartialEq)]
#[pyclass(name = "BooleanFunction")]
#[derive(Copy, Clone)]
pub enum PyBooleanFunction {
Any,
All,
Expand Down Expand Up @@ -212,8 +212,8 @@ impl PyBooleanFunction {
}
}

#[pyclass(name = "TemporalFunction", eq)]
#[derive(Copy, Clone, PartialEq)]
#[pyclass(name = "TemporalFunction")]
#[derive(Copy, Clone)]
pub enum PyTemporalFunction {
Millennium,
Century,
Expand Down
8 changes: 1 addition & 7 deletions crates/polars-utils/src/python_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
pub const PYTHON_SERDE_MAGIC_BYTE_MARK: &[u8] = "PLPYUDF".as_bytes();
pub static PYTHON_VERSION_MINOR: Lazy<u8> = Lazy::new(get_python_minor_version);

#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct PythonFunction(pub PyObject);

impl Clone for PythonFunction {
fn clone(&self) -> Self {
Python::with_gil(|py| Self(self.0.clone_ref(py)))
}
}

impl From<PyObject> for PythonFunction {
fn from(value: PyObject) -> Self {
Self(value)
Expand Down
Loading