From 5e6854171b4883418c9dbc5dd20f1bb10a23f98f Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Mon, 15 Apr 2024 21:34:26 +0200 Subject: [PATCH] rust polars 0.39.1 (#15676) --- Cargo.lock | 36 +++++++++---------- Cargo.toml | 36 +++++++++---------- crates/polars-arrow/src/buffer/immutable.rs | 1 - crates/polars-core/src/chunked_array/drop.rs | 5 +-- .../src/chunked_array/ops/bit_repr.rs | 4 +-- .../src/series/implementations/object.rs | 1 + crates/polars-json/src/ndjson/deserialize.rs | 5 ++- crates/polars-pipe/src/pipeline/convert.rs | 6 ++-- py-polars/src/lib.rs | 1 + rust-toolchain.toml | 2 +- 10 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 978dccc686d5..56ce723cb74e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2662,7 +2662,7 @@ dependencies = [ [[package]] name = "polars" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "apache-avro", @@ -2691,7 +2691,7 @@ dependencies = [ [[package]] name = "polars-arrow" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "arrow-array", @@ -2759,7 +2759,7 @@ dependencies = [ [[package]] name = "polars-compute" -version = "0.39.0" +version = "0.39.1" dependencies = [ "bytemuck", "either", @@ -2774,7 +2774,7 @@ dependencies = [ [[package]] name = "polars-core" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "arrow-array", @@ -2809,7 +2809,7 @@ dependencies = [ [[package]] name = "polars-doc-examples" -version = "0.39.0" +version = "0.39.1" dependencies = [ "aws-config", "aws-sdk-s3", @@ -2822,7 +2822,7 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.39.0" +version = "0.39.1" dependencies = [ "avro-schema", "object_store", @@ -2834,7 +2834,7 @@ dependencies = [ [[package]] name = "polars-ffi" -version = "0.39.0" +version = "0.39.1" dependencies = [ "polars-arrow", "polars-core", @@ -2842,7 +2842,7 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "async-trait", @@ -2886,7 +2886,7 @@ dependencies = [ [[package]] name = "polars-json" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "chrono", @@ -2905,7 +2905,7 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "bitflags 2.5.0", @@ -2931,7 +2931,7 @@ dependencies = [ [[package]] name = "polars-ops" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "aho-corasick", @@ -2966,7 +2966,7 @@ dependencies = [ [[package]] name = "polars-parquet" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "async-stream", @@ -2993,7 +2993,7 @@ dependencies = [ [[package]] name = "polars-pipe" -version = "0.39.0" +version = "0.39.1" dependencies = [ "crossbeam-channel", "crossbeam-queue", @@ -3018,7 +3018,7 @@ dependencies = [ [[package]] name = "polars-plan" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "bytemuck", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "polars-row" -version = "0.39.0" +version = "0.39.1" dependencies = [ "bytemuck", "polars-arrow", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "polars-sql" -version = "0.39.0" +version = "0.39.1" dependencies = [ "hex", "polars-arrow", @@ -3077,7 +3077,7 @@ dependencies = [ [[package]] name = "polars-time" -version = "0.39.0" +version = "0.39.1" dependencies = [ "atoi", "chrono", @@ -3096,7 +3096,7 @@ dependencies = [ [[package]] name = "polars-utils" -version = "0.39.0" +version = "0.39.1" dependencies = [ "ahash", "bytemuck", diff --git a/Cargo.toml b/Cargo.toml index ef1f8dbc40f5..57ed2c8a6382 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ default-members = [ # ] [workspace.package] -version = "0.39.0" +version = "0.39.1" authors = ["Ritchie Vink "] edition = "2021" homepage = "https://www.pola.rs/" @@ -87,22 +87,22 @@ zstd = "0.13" uuid = { version = "1.7.0", features = ["v4"] } arboard = { version = "3.3.2", default-features = false } -polars = { version = "0.39.0", path = "crates/polars", default-features = false } -polars-compute = { version = "0.39.0", path = "crates/polars-compute", default-features = false } -polars-core = { version = "0.39.0", path = "crates/polars-core", default-features = false } -polars-error = { version = "0.39.0", path = "crates/polars-error", default-features = false } -polars-ffi = { version = "0.39.0", path = "crates/polars-ffi", default-features = false } -polars-io = { version = "0.39.0", path = "crates/polars-io", default-features = false } -polars-json = { version = "0.39.0", path = "crates/polars-json", default-features = false } -polars-lazy = { version = "0.39.0", path = "crates/polars-lazy", default-features = false } -polars-ops = { version = "0.39.0", path = "crates/polars-ops", default-features = false } -polars-parquet = { version = "0.39.0", path = "crates/polars-parquet", default-features = false } -polars-pipe = { version = "0.39.0", path = "crates/polars-pipe", default-features = false } -polars-plan = { version = "0.39.0", path = "crates/polars-plan", default-features = false } -polars-row = { version = "0.39.0", path = "crates/polars-row", default-features = false } -polars-sql = { version = "0.39.0", path = "crates/polars-sql", default-features = false } -polars-time = { version = "0.39.0", path = "crates/polars-time", default-features = false } -polars-utils = { version = "0.39.0", path = "crates/polars-utils", default-features = false } +polars = { version = "0.39.1", path = "crates/polars", default-features = false } +polars-compute = { version = "0.39.1", path = "crates/polars-compute", default-features = false } +polars-core = { version = "0.39.1", path = "crates/polars-core", default-features = false } +polars-error = { version = "0.39.1", path = "crates/polars-error", default-features = false } +polars-ffi = { version = "0.39.1", path = "crates/polars-ffi", default-features = false } +polars-io = { version = "0.39.1", path = "crates/polars-io", default-features = false } +polars-json = { version = "0.39.1", path = "crates/polars-json", default-features = false } +polars-lazy = { version = "0.39.1", path = "crates/polars-lazy", default-features = false } +polars-ops = { version = "0.39.1", path = "crates/polars-ops", default-features = false } +polars-parquet = { version = "0.39.1", path = "crates/polars-parquet", default-features = false } +polars-pipe = { version = "0.39.1", path = "crates/polars-pipe", default-features = false } +polars-plan = { version = "0.39.1", path = "crates/polars-plan", default-features = false } +polars-row = { version = "0.39.1", path = "crates/polars-row", default-features = false } +polars-sql = { version = "0.39.1", path = "crates/polars-sql", default-features = false } +polars-time = { version = "0.39.1", path = "crates/polars-time", default-features = false } +polars-utils = { version = "0.39.1", path = "crates/polars-utils", default-features = false } [workspace.dependencies.arrow-format] package = "polars-arrow-format" @@ -110,7 +110,7 @@ version = "0.1.0" [workspace.dependencies.arrow] package = "polars-arrow" -version = "0.39.0" +version = "0.39.1" path = "crates/polars-arrow" default-features = false features = [ diff --git a/crates/polars-arrow/src/buffer/immutable.rs b/crates/polars-arrow/src/buffer/immutable.rs index 158a0ed4f61d..ba813acb0ec0 100644 --- a/crates/polars-arrow/src/buffer/immutable.rs +++ b/crates/polars-arrow/src/buffer/immutable.rs @@ -1,6 +1,5 @@ use std::ops::Deref; use std::sync::Arc; -use std::usize; use either::Either; use num_traits::Zero; diff --git a/crates/polars-core/src/chunked_array/drop.rs b/crates/polars-core/src/chunked_array/drop.rs index f92503dda242..280aa15c6ed2 100644 --- a/crates/polars-core/src/chunked_array/drop.rs +++ b/crates/polars-core/src/chunked_array/drop.rs @@ -7,10 +7,11 @@ impl Drop for ChunkedArray { // SAFETY: // guarded by the type system // the transmute only convinces the type system that we are a list - // (which we are) #[allow(clippy::transmute_undefined_repr)] unsafe { - drop_list(std::mem::transmute(self)) + drop_list(std::mem::transmute::<&mut ChunkedArray, &ListChunked>( + self, + )) } } } diff --git a/crates/polars-core/src/chunked_array/ops/bit_repr.rs b/crates/polars-core/src/chunked_array/ops/bit_repr.rs index 0eeb27a521ed..3ccc0624d1c3 100644 --- a/crates/polars-core/src/chunked_array/ops/bit_repr.rs +++ b/crates/polars-core/src/chunked_array/ops/bit_repr.rs @@ -112,7 +112,7 @@ where if matches!(self.dtype(), DataType::UInt64) { let ca = self.clone(); // Convince the compiler we are this type. This keeps flags. - return unsafe { std::mem::transmute(ca) }; + return unsafe { std::mem::transmute::, UInt64Chunked>(ca) }; } reinterpret_chunked_array(self) } else { @@ -125,7 +125,7 @@ where if matches!(self.dtype(), DataType::UInt32) { let ca = self.clone(); // Convince the compiler we are this type. This preserves flags. - return unsafe { std::mem::transmute(ca) }; + return unsafe { std::mem::transmute::, UInt32Chunked>(ca) }; } reinterpret_chunked_array(self) } else { diff --git a/crates/polars-core/src/series/implementations/object.rs b/crates/polars-core/src/series/implementations/object.rs index d60b474c376d..7db6e2b55bef 100644 --- a/crates/polars-core/src/series/implementations/object.rs +++ b/crates/polars-core/src/series/implementations/object.rs @@ -229,6 +229,7 @@ mod test { #[test] fn test_downcast_object() -> PolarsResult<()> { + #[allow(non_local_definitions)] impl PolarsObject for i32 { fn type_name() -> &'static str { "i32" diff --git a/crates/polars-json/src/ndjson/deserialize.rs b/crates/polars-json/src/ndjson/deserialize.rs index 27fbd5c422bd..35961e96c9a2 100644 --- a/crates/polars-json/src/ndjson/deserialize.rs +++ b/crates/polars-json/src/ndjson/deserialize.rs @@ -20,8 +20,7 @@ pub fn deserialize_iter<'a>( count: usize, ) -> PolarsResult { let mut arr: Vec> = Vec::new(); - let mut buf = - String::with_capacity(std::cmp::min(buf_size + count + 2, std::u32::MAX as usize)); + let mut buf = String::with_capacity(std::cmp::min(buf_size + count + 2, u32::MAX as usize)); buf.push('['); fn _deserializer(s: &mut str, data_type: ArrowDataType) -> PolarsResult> { @@ -41,7 +40,7 @@ pub fn deserialize_iter<'a>( buf.push(','); let next_row_length = row_iter.peek().map(|row| row.len()).unwrap_or(0); - if buf.len() + next_row_length >= std::u32::MAX as usize { + if buf.len() + next_row_length >= u32::MAX as usize { let _ = buf.pop(); buf.push(']'); arr.push(_deserializer(&mut buf, data_type.clone())?); diff --git a/crates/polars-pipe/src/pipeline/convert.rs b/crates/polars-pipe/src/pipeline/convert.rs index 5cd430989892..73afa86fea0a 100644 --- a/crates/polars-pipe/src/pipeline/convert.rs +++ b/crates/polars-pipe/src/pipeline/convert.rs @@ -18,7 +18,7 @@ use crate::executors::{operators, sources}; use crate::expressions::PhysicalPipedExpr; use crate::operators::{Operator, Sink as SinkTrait, Source}; use crate::pipeline::dispatcher::ThreadedSink; -use crate::pipeline::PipeLine; +use crate::pipeline::{PhysOperator, PipeLine}; pub type CallBacks = PlHashMap; @@ -758,7 +758,9 @@ where Ok(PipeLine::new( source_objects, - unsafe { std::mem::transmute(operator_objects) }, + unsafe { + std::mem::transmute::>, Vec>(operator_objects) + }, sinks, verbose, )) diff --git a/py-polars/src/lib.rs b/py-polars/src/lib.rs index 00193e5158c1..4199a76fb0cc 100644 --- a/py-polars/src/lib.rs +++ b/py-polars/src/lib.rs @@ -1,6 +1,7 @@ #![feature(vec_into_raw_parts)] #![allow(clippy::nonstandard_macro_braces)] // Needed because clippy does not understand proc macro of PyO3 #![allow(clippy::transmute_undefined_repr)] +#![allow(non_local_definitions)] #![allow(clippy::too_many_arguments)] // Python functions can have many arguments due to default arguments extern crate polars as polars_rs; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9b6fc432e939..bd59164eb3de 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-28" +channel = "nightly-2024-04-15"