Skip to content

Commit

Permalink
release pyo3-polars 0.8 and pyo3-polars-derive 0.2 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Oct 24, 2023
1 parent 0a3df66 commit 53082c3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
16 changes: 5 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ members = [
]

[workspace.dependencies]
polars = { git = "https://github.com/pola-rs/polars", rev = "d00a43203b3ade009a5f858f4c698b6a50f5b1e6", version = "0.33.2", default-features = false }
polars-core = { git = "https://github.com/pola-rs/polars", rev = "d00a43203b3ade009a5f858f4c698b6a50f5b1e6", version = "0.33.2", default-features = false }
polars-ffi = { git = "https://github.com/pola-rs/polars", rev = "d00a43203b3ade009a5f858f4c698b6a50f5b1e6", version = "0.33.2", default-features = false }
polars-plan = { git = "https://github.com/pola-rs/polars", rev = "d00a43203b3ade009a5f858f4c698b6a50f5b1e6", version = "0.33.2", default-feautres = false }
polars-lazy = { git = "https://github.com/pola-rs/polars", rev = "d00a43203b3ade009a5f858f4c698b6a50f5b1e6", version = "0.33.2", default-features = false }

#polars = { path = "../polars/crates/polars", version = "0.33.2", default-features = false }
#polars-core = { path = "../polars/crates/polars-core", version = "0.33.2", default-features = false }
#polars-ffi = { path = "../polars/crates/polars-ffi", version = "0.33.2", default-features = false }
#polars-plan = { path = "../polars/crates/polars-plan", version = "0.33.2", default-feautres = false }
#polars-lazy = { path = "../polars/crates/polars-lazy", version = "0.33.2", default-features = false }
polars = { version = "0.34", default-features = false }
polars-core = { version = "0.34", default-features = false }
polars-ffi = { version = "0.34", default-features = false }
polars-plan = { version = "0.34", default-feautres = false }
polars-lazy = { version = "0.34", default-features = false }
4 changes: 1 addition & 3 deletions example/derive_expression/expression_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ crate-type = ["cdylib"]

[dependencies]
polars = { workspace = true, features = ["fmt", "dtype-date"], default-features = false }
polars-plan = { workspace = true, default-features = false }
pyo3 = { version = "0.20.0", features = ["extension-module"] }
pyo3-polars = { version = "*", path = "../../../pyo3-polars", features = ["derive"] }
serde = { version = "1", features = ["derive"] }

[target.'cfg(target_os = "linux")']
[target.'cfg(target_os = "linux")'.dependencies]
jemallocator = { version = "0.5", features = ["disable_initial_exec_tls"] }
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn haversine_output(input_fields: &[Field]) -> PolarsResult<Field> {
FieldsMapper::new(input_fields).map_to_float_dtype()
}

#[polars_expr(type_func=haversine_output)]
#[polars_expr(output_type_func=haversine_output)]
fn haversine(inputs: &[Series]) -> PolarsResult<Series> {
let out = match inputs[0].dtype() {
DataType::Float32 => {
Expand Down
2 changes: 1 addition & 1 deletion pyo3-polars-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-polars-derive"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
license = "MIT"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions pyo3-polars-derive/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<K: Parse, V: Parse> Parse for KeyWordAttribute<K, V> {
}

pub type OutputAttribute = KeyWordAttribute<keywords::output_type, Ident>;
pub type OutputFuncAttribute = KeyWordAttribute<keywords::type_func, Ident>;
pub type OutputFuncAttribute = KeyWordAttribute<keywords::output_type_func, Ident>;

#[derive(Default, Debug)]
pub struct ExprsFunctionOptions {
Expand All @@ -38,7 +38,7 @@ impl Parse for ExprsFunctionOptions {
if lookahead.peek(keywords::output_type) {
let attr = input.parse::<OutputAttribute>()?;
options.output_dtype = Some(attr.value)
} else if lookahead.peek(keywords::type_func) {
} else if lookahead.peek(keywords::output_type_func) {
let attr = input.parse::<OutputFuncAttribute>()?;
options.output_type_fn = Some(attr.value)
} else {
Expand Down
2 changes: 1 addition & 1 deletion pyo3-polars-derive/src/keywords.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
syn::custom_keyword!(output_type);
syn::custom_keyword!(type_func);
syn::custom_keyword!(output_type_func);
4 changes: 2 additions & 2 deletions pyo3-polars/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-polars"
version = "0.7.0"
version = "0.8.0"
edition = "2021"
license = "MIT"
readme = "../README.md"
Expand All @@ -17,7 +17,7 @@ polars-ffi = { workspace = true, optional = true }
polars-lazy = { workspace = true, optional = true }
polars-plan = { workspace = true, optional = true }
pyo3 = "0.20.0"
pyo3-polars-derive = { version = "0.1.0", path = "../pyo3-polars-derive", optional = true }
pyo3-polars-derive = { version = "0.2.0", path = "../pyo3-polars-derive", optional = true }
serde = { version = "1", optional = true }
serde-pickle = { version = "1", optional = true }
thiserror = "1"
Expand Down

0 comments on commit 53082c3

Please sign in to comment.