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

Commit 43fcc96

Browse files
committed
Update to Rust Polars 0.48
1 parent 88f874b commit 43fcc96

File tree

17 files changed

+68
-43
lines changed

17 files changed

+68
-43
lines changed

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ 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

example/derive_expression/expression_lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ crate-type = ["cdylib"]
1111
[dependencies]
1212
polars = { workspace = true, features = ["fmt", "dtype-date", "timezones"], 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"] }
1616
rayon = "1.7.0"
1717
serde = { version = "1", features = ["derive"] }

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
}

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"

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 = [] }

example/io_plugin/io_plugin/io_plugin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ def source_generator(
4242

4343
# create src again to compute the schema
4444
src = RandomSource(samplers, 0, 0)
45-
return register_io_source(callable=source_generator, schema=src.schema())
45+
return register_io_source(io_source=source_generator, schema=src.schema())

example/io_plugin/io_plugin/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 = "io_plugin"
7+
version = "0.0.1"
78
requires-python = ">=3.10"
89
classifiers = [
910
"Programming Language :: Rust",

example/io_plugin/io_plugin/src/samplers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ where
5252
}
5353

5454
fn dtype(&self) -> DataType {
55-
T::PolarsType::get_dtype()
55+
T::PolarsType::get_static_dtype()
5656
}
5757

5858
fn next_n(&mut self, n: usize) -> Series {

0 commit comments

Comments
 (0)