Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 3157958

Browse files
authored
chore: Update to Rust Polars 0.48 (#141)
1 parent 88f874b commit 3157958

File tree

21 files changed

+91
-69
lines changed

21 files changed

+91
-69
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up Rust
3232
run: rustup show
3333

34-
- uses: mozilla-actions/[email protected].3
34+
- uses: mozilla-actions/[email protected].8
3535

3636
- run: cargo test
3737
working-directory: pyo3-polars

Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ members = [
99
]
1010

1111
[workspace.dependencies]
12-
polars = { version = "0.46.0", default-features = false }
13-
polars-core = { version = "0.46.0", default-features = false }
14-
polars-arrow = { version = "0.46.0", default-features = false }
15-
polars-ffi = { version = "0.46.0", default-features = false }
16-
polars-plan = { version = "0.46.0", default-features = false }
17-
polars-lazy = { version = "0.46.0", default-features = false }
18-
polars-python = {version = "0.46.0", default-features = false }
19-
polars-utils = {version = "0.46.0", default-features = false}
12+
polars = { version = "0.48.0", default-features = false }
13+
polars-core = { version = "0.48.0", default-features = false }
14+
polars-arrow = { version = "0.48.0", default-features = false }
15+
polars-ffi = { version = "0.48.0", default-features = false }
16+
polars-plan = { version = "0.48.0", default-features = false }
17+
polars-lazy = { version = "0.48.0", default-features = false }
18+
polars-python = { version = "0.48.0", default-features = false }
19+
polars-utils = { version = "0.48.0", default-features = false }
2020

2121
[workspace.dependencies.arrow]
2222
package = "polars-arrow"
23-
version = "0.46.0"
23+
version = "0.48.0"
2424
path = "../polars/crates/polars-arrow"
2525
default-features = false
2626

27-
#[patch.crates-io]
28-
#polars = { git = "https://github.com/pola-rs/polars.git" }
29-
#polars-core = { git = "https://github.com/pola-rs/polars.git" }
30-
#polars-ffi = { git = "https://github.com/pola-rs/polars.git" }
31-
#polars-plan = { git = "https://github.com/pola-rs/polars.git" }
32-
#polars-lazy = { git = "https://github.com/pola-rs/polars.git" }
27+
# [patch.crates-io]
28+
# polars = { git = "https://github.com/pola-rs/polars.git" }
29+
# polars-core = { git = "https://github.com/pola-rs/polars.git" }
30+
# polars-ffi = { git = "https://github.com/pola-rs/polars.git" }
31+
# polars-plan = { git = "https://github.com/pola-rs/polars.git" }
32+
# polars-lazy = { git = "https://github.com/pola-rs/polars.git" }

example/derive_expression/expression_lib/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ name = "expression_lib"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
polars = { workspace = true, features = ["fmt", "dtype-date", "timezones"], default-features = false }
12+
num = "*"
13+
polars = { workspace = true, features = ["fmt", "dtype-date", "timezones", "object"], default-features = false }
1314
polars-arrow = { workspace = true, default-features = false }
14-
pyo3 = { version = "0.23", features = ["abi3-py38"] }
15+
pyo3 = { version = "0.24.2", features = ["abi3-py38"] }
1516
pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["derive"] }
1617
rayon = "1.7.0"
1718
serde = { version = "1", features = ["derive"] }
18-
num = "*"

example/derive_expression/expression_lib/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "expression_lib"
7+
version = "0.0.1"
78
requires-python = ">=3.8"
89
classifiers = [
910
"Programming Language :: Rust",

example/derive_expression/expression_lib/src/distances.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ fn jacc_helper<T: NativeType + Hash + Eq>(a: &PrimitiveArray<T>, b: &PrimitiveAr
2525
s3_len as f64 / (s1.len() + s2.len() - s3_len) as f64
2626
}
2727

28+
#[allow(unexpected_cfgs)]
2829
pub(super) fn naive_jaccard_sim(a: &ListChunked, b: &ListChunked) -> PolarsResult<Float64Chunked> {
2930
polars_ensure!(
3031
a.inner_dtype() == b.inner_dtype(),

example/derive_expression/expression_lib/src/expressions.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ struct TimeZone {
193193

194194
fn convert_timezone(input_fields: &[Field], kwargs: TimeZone) -> PolarsResult<Field> {
195195
FieldsMapper::new(input_fields).try_map_dtype(|dtype| match dtype {
196-
DataType::Datetime(tu, _) => Ok(DataType::Datetime(*tu, Some(kwargs.tz.into()))),
196+
DataType::Datetime(tu, _) => Ok(DataType::Datetime(
197+
*tu,
198+
datatypes::TimeZone::opt_try_new(Some(kwargs.tz))?,
199+
)),
197200
_ => polars_bail!(ComputeError: "expected datetime"),
198201
})
199202
}
@@ -206,6 +209,11 @@ fn change_time_zone(input: &[Series], kwargs: TimeZone) -> PolarsResult<Series>
206209
let ca = input.datetime()?;
207210

208211
let mut out = ca.clone();
209-
out.set_time_zone(kwargs.tz.into())?;
212+
213+
let Some(timezone) = datatypes::TimeZone::opt_try_new(Some(kwargs.tz))? else {
214+
polars_bail!(ComputeError: "expected timezone")
215+
};
216+
217+
out.set_time_zone(timezone)?;
210218
Ok(out.into_series())
211219
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
maturin
2-
polars
2+
polars>=1.30.0b1

example/extend_polars_python_dispatch/extend_polars/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ name = "extend_polars"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
polars = { workspace = true, features = ["fmt"] }
12+
polars = { workspace = true, features = ["fmt", "object"] }
1313
polars-core = { workspace = true }
1414
polars-lazy = { workspace = true }
15-
pyo3 = { version = "0.23", features = ["extension-module"] }
15+
pyo3 = { version = "0.24.2", features = ["extension-module"] }
1616
pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["lazy"] }
1717
rayon = "1.10"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
maturin
2-
polars[pyarrow]
2+
polars[pyarrow]>=1.30.0b1

example/io_plugin/io_plugin/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ name = "io_plugin"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
polars = { workspace = true, features = ["fmt", "dtype-date", "timezones", "lazy"], default-features = false }
12+
polars = { workspace = true, features = ["fmt", "dtype-date", "timezones", "lazy", "object", "strings"], default-features = false }
1313
polars-arrow = { workspace = true, default-features = false }
14-
pyo3 = { version = "0.23", features = ["abi3-py38"] }
14+
pyo3 = { version = "0.24.2", features = ["abi3-py38"] }
1515
pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["derive", "lazy"] }
1616
rand = { version = "0.8.5", features = [] }

0 commit comments

Comments
 (0)