From d1b6df0e4059512fa1c5a5447cc1a2fdb54956c3 Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Sun, 8 Dec 2024 14:19:16 +0100 Subject: [PATCH] pyo3-polars 0.19/Polars 0.45 (#121) --- example/derive_expression/expression_lib/Cargo.toml | 2 +- .../extend_polars_python_dispatch/extend_polars/Cargo.toml | 2 +- example/io_plugin/io_plugin/Cargo.toml | 2 +- pyo3-polars-derive/Cargo.toml | 2 +- pyo3-polars/Cargo.toml | 6 +++--- pyo3-polars/src/types.rs | 4 +++- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/example/derive_expression/expression_lib/Cargo.toml b/example/derive_expression/expression_lib/Cargo.toml index 23dc2e7..017418b 100644 --- a/example/derive_expression/expression_lib/Cargo.toml +++ b/example/derive_expression/expression_lib/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] polars = { workspace = true, features = ["fmt", "dtype-date", "timezones"], default-features = false } -pyo3 = { version = "0.21", features = ["abi3-py38"] } +pyo3 = { version = "0.22", features = ["abi3-py38"] } pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["derive"] } rayon = "1.7.0" serde = { version = "1", features = ["derive"] } diff --git a/example/extend_polars_python_dispatch/extend_polars/Cargo.toml b/example/extend_polars_python_dispatch/extend_polars/Cargo.toml index d24467e..4a6ee08 100644 --- a/example/extend_polars_python_dispatch/extend_polars/Cargo.toml +++ b/example/extend_polars_python_dispatch/extend_polars/Cargo.toml @@ -12,6 +12,6 @@ crate-type = ["cdylib"] polars = { workspace = true, features = ["fmt"] } polars-core = { workspace = true } polars-lazy = { workspace = true } -pyo3 = { version = "0.21", features = ["extension-module"] } +pyo3 = { version = "0.22", features = ["extension-module"] } pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["lazy"] } rayon = "1.10" diff --git a/example/io_plugin/io_plugin/Cargo.toml b/example/io_plugin/io_plugin/Cargo.toml index c611040..6312d19 100644 --- a/example/io_plugin/io_plugin/Cargo.toml +++ b/example/io_plugin/io_plugin/Cargo.toml @@ -10,6 +10,6 @@ crate-type = ["cdylib"] [dependencies] polars = { workspace = true, features = ["fmt", "dtype-date", "timezones", "lazy"], default-features = false } -pyo3 = { version = "0.21", features = ["abi3-py38"] } +pyo3 = { version = "0.22", features = ["abi3-py38"] } pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["derive", "lazy"] } rand = { version = "0.8.5", features = [] } diff --git a/pyo3-polars-derive/Cargo.toml b/pyo3-polars-derive/Cargo.toml index 2b685b2..7d34c9e 100644 --- a/pyo3-polars-derive/Cargo.toml +++ b/pyo3-polars-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-polars-derive" -version = "0.12.0" +version = "0.13.0" edition = "2021" license = "MIT" readme = "README.md" diff --git a/pyo3-polars/Cargo.toml b/pyo3-polars/Cargo.toml index 06e613e..a19f796 100644 --- a/pyo3-polars/Cargo.toml +++ b/pyo3-polars/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-polars" -version = "0.18.0" +version = "0.19.0" edition = "2021" license = "MIT" readme = "../README.md" @@ -18,8 +18,8 @@ polars-core = { workspace = true, default-features = false } polars-ffi = { workspace = true, optional = true } polars-lazy = { workspace = true, optional = true } polars-plan = { workspace = true, optional = true } -pyo3 = "0.21" -pyo3-polars-derive = { version = "0.12.0", path = "../pyo3-polars-derive", optional = true } +pyo3 = "0.22" +pyo3-polars-derive = { version = "0.13.0", path = "../pyo3-polars-derive", optional = true } serde = { version = "1", optional = true } serde-pickle = { version = "1", optional = true } thiserror = "1" diff --git a/pyo3-polars/src/types.rs b/pyo3-polars/src/types.rs index c7ad060..dd4fede 100644 --- a/pyo3-polars/src/types.rs +++ b/pyo3-polars/src/types.rs @@ -494,6 +494,8 @@ impl ToPyObject for PyDataType { DataType::BinaryOffset => { panic!("this type isn't exposed to python") } + #[allow(unreachable_patterns)] + _ => panic!("activate dtype"), } } } @@ -511,7 +513,7 @@ impl IntoPy for PySchema { impl<'py> FromPyObject<'py> for PyDataType { fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult { let py = ob.py(); - let type_name = ob.get_type().qualname()?; + let type_name = ob.get_type().qualname()?.to_string(); let dtype = match type_name.as_ref() { "DataTypeClass" => {