diff --git a/crates/polars-arrow/src/array/boolean/mod.rs b/crates/polars-arrow/src/array/boolean/mod.rs index c15616c646b6..bb7aea1b6b26 100644 --- a/crates/polars-arrow/src/array/boolean/mod.rs +++ b/crates/polars-arrow/src/array/boolean/mod.rs @@ -14,7 +14,6 @@ mod from; mod iterator; mod mutable; -pub use iterator::*; pub use mutable::*; use polars_error::{polars_bail, PolarsResult}; diff --git a/crates/polars-arrow/src/array/fixed_size_list/mod.rs b/crates/polars-arrow/src/array/fixed_size_list/mod.rs index 541374773321..612e134a5a5d 100644 --- a/crates/polars-arrow/src/array/fixed_size_list/mod.rs +++ b/crates/polars-arrow/src/array/fixed_size_list/mod.rs @@ -7,7 +7,7 @@ mod data; mod ffi; pub(super) mod fmt; mod iterator; -pub use iterator::*; + mod mutable; pub use mutable::*; use polars_error::{polars_bail, PolarsResult}; diff --git a/crates/polars-arrow/src/array/growable/structure.rs b/crates/polars-arrow/src/array/growable/structure.rs index 10afd20e7f06..c4577599a49a 100644 --- a/crates/polars-arrow/src/array/growable/structure.rs +++ b/crates/polars-arrow/src/array/growable/structure.rs @@ -103,7 +103,7 @@ impl<'a> Growable<'a> for GrowableStruct<'a> { // All children should have the same indexing, so just use the first // one. If we don't have children, we might still have a validity // array, so use that. - if let Some(child) = self.values.get(0) { + if let Some(child) = self.values.first() { child.len() } else { self.validity.len() diff --git a/crates/polars-arrow/src/array/map/mod.rs b/crates/polars-arrow/src/array/map/mod.rs index daed3971eae7..d057192ef612 100644 --- a/crates/polars-arrow/src/array/map/mod.rs +++ b/crates/polars-arrow/src/array/map/mod.rs @@ -9,7 +9,7 @@ mod data; mod ffi; pub(super) mod fmt; mod iterator; -pub use iterator::*; + use polars_error::{polars_bail, PolarsResult}; /// An array representing a (key, value), both of arbitrary logical types. diff --git a/crates/polars-arrow/src/array/primitive/mod.rs b/crates/polars-arrow/src/array/primitive/mod.rs index 41c8d6fd769a..b6d14b80747c 100644 --- a/crates/polars-arrow/src/array/primitive/mod.rs +++ b/crates/polars-arrow/src/array/primitive/mod.rs @@ -14,7 +14,7 @@ mod ffi; pub(super) mod fmt; mod from_natural; mod iterator; -pub use iterator::*; + mod mutable; pub use mutable::*; use polars_error::{polars_bail, PolarsResult}; diff --git a/crates/polars-arrow/src/compute/aggregate/simd/mod.rs b/crates/polars-arrow/src/compute/aggregate/simd/mod.rs index 25558e9a9e19..9b5809ac9b76 100644 --- a/crates/polars-arrow/src/compute/aggregate/simd/mod.rs +++ b/crates/polars-arrow/src/compute/aggregate/simd/mod.rs @@ -100,10 +100,6 @@ simd_ord_int!(i128x8, i128); #[cfg(not(feature = "simd"))] mod native; -#[cfg(not(feature = "simd"))] -pub use native::*; + #[cfg(feature = "simd")] mod packed; -#[cfg(feature = "simd")] -#[cfg_attr(docsrs, doc(cfg(feature = "simd")))] -pub use packed::*; diff --git a/crates/polars-arrow/src/compute/comparison/simd/mod.rs b/crates/polars-arrow/src/compute/comparison/simd/mod.rs index 30d9773cd4c9..11fe33e360f2 100644 --- a/crates/polars-arrow/src/compute/comparison/simd/mod.rs +++ b/crates/polars-arrow/src/compute/comparison/simd/mod.rs @@ -125,9 +125,6 @@ macro_rules! simd8_native_all { #[cfg(not(feature = "simd"))] mod native; -#[cfg(not(feature = "simd"))] -pub use native::*; + #[cfg(feature = "simd")] mod packed; -#[cfg(feature = "simd")] -pub use packed::*; diff --git a/crates/polars-arrow/src/legacy/kernels/sort_partition.rs b/crates/polars-arrow/src/legacy/kernels/sort_partition.rs index e37182e980df..8fbf75d47d79 100644 --- a/crates/polars-arrow/src/legacy/kernels/sort_partition.rs +++ b/crates/polars-arrow/src/legacy/kernels/sort_partition.rs @@ -76,7 +76,7 @@ pub fn partition_to_groups_amortized( ) where T: Debug + NativeType + PartialOrd, { - if let Some(mut first) = values.get(0) { + if let Some(mut first) = values.first() { out.clear(); if nulls_first && first_group_offset > 0 { out.push([0, first_group_offset]) diff --git a/crates/polars-core/src/chunked_array/logical/struct_/mod.rs b/crates/polars-core/src/chunked_array/logical/struct_/mod.rs index 092479722ecb..6e17bc65c209 100644 --- a/crates/polars-core/src/chunked_array/logical/struct_/mod.rs +++ b/crates/polars-core/src/chunked_array/logical/struct_/mod.rs @@ -73,7 +73,7 @@ impl StructChunked { } pub fn new(name: &str, fields: &[Series]) -> PolarsResult { let mut names = PlHashSet::with_capacity(fields.len()); - let first_len = fields.get(0).map(|s| s.len()).unwrap_or(0); + let first_len = fields.first().map(|s| s.len()).unwrap_or(0); let mut max_len = first_len; let mut all_equal_len = true; @@ -243,7 +243,7 @@ impl StructChunked { } pub fn len(&self) -> usize { - self.fields.get(0).map(|s| s.len()).unwrap_or(0) + self.fields.first().map(|s| s.len()).unwrap_or(0) } pub fn is_empty(&self) -> bool { self.len() == 0 diff --git a/crates/polars-core/src/chunked_array/ops/rolling_window.rs b/crates/polars-core/src/chunked_array/ops/rolling_window.rs index cd5671265513..08e1376eb312 100644 --- a/crates/polars-core/src/chunked_array/ops/rolling_window.rs +++ b/crates/polars-core/src/chunked_array/ops/rolling_window.rs @@ -250,6 +250,3 @@ mod inner_mod { } } } - -#[cfg(feature = "rolling_window")] -pub use inner_mod::*; diff --git a/crates/polars-core/src/datatypes/_serde.rs b/crates/polars-core/src/datatypes/_serde.rs index b09f501c9a72..2008b655cad9 100644 --- a/crates/polars-core/src/datatypes/_serde.rs +++ b/crates/polars-core/src/datatypes/_serde.rs @@ -3,7 +3,7 @@ //! //! We could use [serde_1712](https://github.com/serde-rs/serde/issues/1712), but that gave problems caused by //! [rust_96956](https://github.com/rust-lang/rust/issues/96956), so we make a dummy type without static -pub use arrow::datatypes::ArrowDataType; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use super::*; diff --git a/crates/polars-core/src/frame/mod.rs b/crates/polars-core/src/frame/mod.rs index 8b4ca72689ad..9872b9a7254e 100644 --- a/crates/polars-core/src/frame/mod.rs +++ b/crates/polars-core/src/frame/mod.rs @@ -626,7 +626,7 @@ impl DataFrame { /// The number of chunks per column pub fn n_chunks(&self) -> usize { - match self.columns.get(0) { + match self.columns.first() { None => 0, Some(s) => s.n_chunks(), } @@ -1234,7 +1234,7 @@ impl DataFrame { /// } /// ``` pub fn get(&self, idx: usize) -> Option> { - match self.columns.get(0) { + match self.columns.first() { Some(s) => { if s.len() <= idx { return None; diff --git a/crates/polars-core/src/prelude.rs b/crates/polars-core/src/prelude.rs index b9b3e352b120..349322d4084a 100644 --- a/crates/polars-core/src/prelude.rs +++ b/crates/polars-core/src/prelude.rs @@ -49,7 +49,6 @@ pub use crate::schema::*; pub use crate::series::arithmetic::checked::NumOpsDispatchChecked; pub use crate::series::arithmetic::{LhsNumOps, NumOpsDispatch}; pub use crate::series::{IntoSeries, Series, SeriesTrait}; -pub use crate::testing::*; pub(crate) use crate::utils::CustomIterTools; pub use crate::utils::IntoVec; pub use crate::{datatypes, df}; diff --git a/crates/polars-core/src/series/series_trait.rs b/crates/polars-core/src/series/series_trait.rs index 27ac2d735e38..6860ab3f93ba 100644 --- a/crates/polars-core/src/series/series_trait.rs +++ b/crates/polars-core/src/series/series_trait.rs @@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "object")] use crate::chunked_array::object::PolarsObjectSafe; -pub use crate::prelude::ChunkCompare; use crate::prelude::*; #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] diff --git a/crates/polars-lazy/src/physical_plan/executors/projection_utils.rs b/crates/polars-lazy/src/physical_plan/executors/projection_utils.rs index fb5fed078ac9..061f54b6e8ce 100644 --- a/crates/polars-lazy/src/physical_plan/executors/projection_utils.rs +++ b/crates/polars-lazy/src/physical_plan/executors/projection_utils.rs @@ -222,7 +222,7 @@ pub(super) fn check_expand_literals( mut selected_columns: Vec, zero_length: bool, ) -> PolarsResult { - let Some(first_len) = selected_columns.get(0).map(|s| s.len()) else { + let Some(first_len) = selected_columns.first().map(|s| s.len()) else { return Ok(DataFrame::empty()); }; let mut df_height = 0; diff --git a/crates/polars-ops/src/chunked_array/strings/json_path.rs b/crates/polars-ops/src/chunked_array/strings/json_path.rs index 39ebd91e4f46..57877beca33e 100644 --- a/crates/polars-ops/src/chunked_array/strings/json_path.rs +++ b/crates/polars-ops/src/chunked_array/strings/json_path.rs @@ -9,7 +9,7 @@ pub fn extract_json<'a>(expr: &PathCompiled, json_str: &'a str) -> Option Some(Cow::Owned(s.clone())), diff --git a/crates/polars-ops/src/frame/join/hash_join/mod.rs b/crates/polars-ops/src/frame/join/hash_join/mod.rs index d79ba7545fd8..f293aadac8a5 100644 --- a/crates/polars-ops/src/frame/join/hash_join/mod.rs +++ b/crates/polars-ops/src/frame/join/hash_join/mod.rs @@ -9,7 +9,6 @@ mod single_keys_semi_anti; pub(super) mod sort_merge; mod zip_outer; -pub use args::*; pub use multiple_keys::private_left_join_multiple_keys; pub(super) use multiple_keys::*; use polars_core::utils::{_set_partition_size, slice_slice, split_ca}; diff --git a/crates/polars-ops/src/series/ops/approx_unique.rs b/crates/polars-ops/src/series/ops/approx_unique.rs index 1ff1c9d21236..9a60d999b055 100644 --- a/crates/polars-ops/src/series/ops/approx_unique.rs +++ b/crates/polars-ops/src/series/ops/approx_unique.rs @@ -4,7 +4,7 @@ use polars_core::prelude::*; use polars_core::with_match_physical_integer_polars_type; #[cfg(feature = "approx_unique")] -use crate::series::HyperLogLog; +use crate::series::ops::approx_algo::HyperLogLog; fn approx_n_unique_ca<'a, T>(ca: &'a ChunkedArray) -> PolarsResult where diff --git a/crates/polars-ops/src/series/ops/mod.rs b/crates/polars-ops/src/series/ops/mod.rs index df92959c9efe..bada83957017 100644 --- a/crates/polars-ops/src/series/ops/mod.rs +++ b/crates/polars-ops/src/series/ops/mod.rs @@ -1,5 +1,6 @@ #[cfg(feature = "abs")] mod abs; +#[cfg(feature = "approx_unique")] mod approx_algo; #[cfg(feature = "approx_unique")] mod approx_unique; @@ -52,6 +53,7 @@ mod various; #[cfg(feature = "abs")] pub use abs::*; +#[cfg(feature = "approx_unique")] pub use approx_algo::*; #[cfg(feature = "approx_unique")] pub use approx_unique::*; diff --git a/crates/polars-parquet/src/arrow/read/deserialize/nested_utils.rs b/crates/polars-parquet/src/arrow/read/deserialize/nested_utils.rs index da88b18a9731..9c089eb2a27c 100644 --- a/crates/polars-parquet/src/arrow/read/deserialize/nested_utils.rs +++ b/crates/polars-parquet/src/arrow/read/deserialize/nested_utils.rs @@ -5,7 +5,6 @@ use arrow::bitmap::MutableBitmap; use polars_error::PolarsResult; use super::super::Pages; -pub use super::utils::Zip; use super::utils::{DecodedState, MaybeNext, PageState}; use crate::parquet::encoding::hybrid_rle::HybridRleDecoder; use crate::parquet::page::{split_buffer, DataPage, DictPage, Page}; diff --git a/crates/polars-parquet/src/parquet/read/page/indexed_reader.rs b/crates/polars-parquet/src/parquet/read/page/indexed_reader.rs index ac11e725070c..e72bc5de82e1 100644 --- a/crates/polars-parquet/src/parquet/read/page/indexed_reader.rs +++ b/crates/polars-parquet/src/parquet/read/page/indexed_reader.rs @@ -147,7 +147,7 @@ impl IndexedPageReader { fn read_dict(&mut self) -> Option> { // a dictionary page exists iff the first data page is not at the start of // the column - let (start, length) = match self.pages.get(0) { + let (start, length) = match self.pages.front() { Some(page) => { let length = (page.start - self.column_start) as usize; if length > 0 { diff --git a/crates/polars-parquet/src/parquet/schema/io_thrift/mod.rs b/crates/polars-parquet/src/parquet/schema/io_thrift/mod.rs index 5176eb131ff2..8e3041f95683 100644 --- a/crates/polars-parquet/src/parquet/schema/io_thrift/mod.rs +++ b/crates/polars-parquet/src/parquet/schema/io_thrift/mod.rs @@ -1,8 +1,6 @@ mod from_thrift; -pub use from_thrift::*; mod to_thrift; -pub use to_thrift::*; #[cfg(test)] mod tests { diff --git a/crates/polars-parquet/src/parquet/write/indexes/serialize.rs b/crates/polars-parquet/src/parquet/write/indexes/serialize.rs index 002ff2059371..5b9572209a2f 100644 --- a/crates/polars-parquet/src/parquet/write/indexes/serialize.rs +++ b/crates/polars-parquet/src/parquet/write/indexes/serialize.rs @@ -1,7 +1,6 @@ use parquet_format_safe::{BoundaryOrder, ColumnIndex, OffsetIndex, PageLocation}; use crate::parquet::error::{Error, Result}; -pub use crate::parquet::metadata::KeyValue; use crate::parquet::statistics::serialize_statistics; use crate::parquet::write::page::{is_data_page, PageWriteSpec}; diff --git a/crates/polars-parquet/src/parquet/write/indexes/write.rs b/crates/polars-parquet/src/parquet/write/indexes/write.rs index 5aab227b7bac..7f47a75debbf 100644 --- a/crates/polars-parquet/src/parquet/write/indexes/write.rs +++ b/crates/polars-parquet/src/parquet/write/indexes/write.rs @@ -8,7 +8,6 @@ use parquet_format_safe::thrift::protocol::TCompactOutputStreamProtocol; use super::serialize::{serialize_column_index, serialize_offset_index}; use crate::parquet::error::Result; -pub use crate::parquet::metadata::KeyValue; use crate::parquet::write::page::PageWriteSpec; pub fn write_column_index(writer: &mut W, pages: &[PageWriteSpec]) -> Result { diff --git a/crates/polars-parquet/src/parquet/write/row_group.rs b/crates/polars-parquet/src/parquet/write/row_group.rs index 943079430aaf..22dc42286bf7 100644 --- a/crates/polars-parquet/src/parquet/write/row_group.rs +++ b/crates/polars-parquet/src/parquet/write/row_group.rs @@ -51,7 +51,7 @@ impl ColumnOffsetsMetadata { fn compute_num_rows(columns: &[(ColumnChunk, Vec)]) -> Result { columns - .get(0) + .first() .map(|(_, specs)| { let mut num_rows = 0; specs @@ -101,7 +101,7 @@ where // compute row group stats let file_offset = columns - .get(0) + .first() .map(|(column_chunk, _)| { ColumnOffsetsMetadata::from_column_chunk(column_chunk).calc_row_group_file_offset() }) @@ -167,7 +167,7 @@ where // compute row group stats let file_offset = columns - .get(0) + .first() .map(|(column_chunk, _)| { ColumnOffsetsMetadata::from_column_chunk(column_chunk).calc_row_group_file_offset() }) diff --git a/crates/polars-plan/src/logical_plan/projection.rs b/crates/polars-plan/src/logical_plan/projection.rs index a5087555ef10..d72953cedd2b 100644 --- a/crates/polars-plan/src/logical_plan/projection.rs +++ b/crates/polars-plan/src/logical_plan/projection.rs @@ -47,7 +47,7 @@ fn rewrite_special_aliases(expr: Expr) -> PolarsResult { Expr::KeepName(expr) => { let roots = expr_to_leaf_column_names(&expr); let name = roots - .get(0) + .first() .expect("expected root column to keep expression name"); Ok(Expr::Alias(expr, name.clone())) }, diff --git a/crates/polars-plan/src/logical_plan/pyarrow.rs b/crates/polars-plan/src/logical_plan/pyarrow.rs index a007887be351..2290ec2b3664 100644 --- a/crates/polars-plan/src/logical_plan/pyarrow.rs +++ b/crates/polars-plan/src/logical_plan/pyarrow.rs @@ -148,7 +148,7 @@ pub(super) fn predicate_to_pa( input, .. } => { - let col = predicate_to_pa(*input.get(0)?, expr_arena, args)?; + let col = predicate_to_pa(*input.first()?, expr_arena, args)?; let mut args = args; args.allow_literal_series = true; let values = predicate_to_pa(*input.get(1)?, expr_arena, args)?; diff --git a/crates/polars-sql/src/context.rs b/crates/polars-sql/src/context.rs index 9774cbbd932c..f472b1267a03 100644 --- a/crates/polars-sql/src/context.rs +++ b/crates/polars-sql/src/context.rs @@ -112,7 +112,7 @@ impl SQLContext { .parse_statements() .map_err(to_compute_err)?; polars_ensure!(ast.len() == 1, ComputeError: "One and only one statement at a time please"); - let res = self.execute_statement(ast.get(0).unwrap()); + let res = self.execute_statement(ast.first().unwrap()); // Every execution should clear the CTE map. self.cte_map.borrow_mut().clear(); self.aliases.borrow_mut().clear(); @@ -337,7 +337,7 @@ impl SQLContext { // Implicit joins require some more work in query parsers, explicit joins are preferred for now. let sql_tbl: &TableWithJoins = select_stmt .from - .get(0) + .first() .ok_or_else(|| polars_err!(ComputeError: "no table name provided in query"))?; let mut lf = self.execute_from_statement(sql_tbl)?; @@ -548,7 +548,7 @@ impl SQLContext { .. } = stmt { - let tbl_name = name.0.get(0).unwrap().value.as_str(); + let tbl_name = name.0.first().unwrap().value.as_str(); // CREATE TABLE IF NOT EXISTS if *if_not_exists && self.table_map.contains_key(tbl_name) { polars_bail!(ComputeError: "relation {} already exists", tbl_name); @@ -579,7 +579,7 @@ impl SQLContext { if let Some(args) = args { return self.execute_tbl_function(name, alias, args); } - let tbl_name = name.0.get(0).unwrap().value.as_str(); + let tbl_name = name.0.first().unwrap().value.as_str(); if let Some(lf) = self.get_table_from_current_scope(tbl_name) { match alias { Some(alias) => { @@ -605,7 +605,7 @@ impl SQLContext { alias: &Option, args: &[FunctionArg], ) -> PolarsResult<(String, LazyFrame)> { - let tbl_fn = name.0.get(0).unwrap().value.as_str(); + let tbl_fn = name.0.first().unwrap().value.as_str(); let read_fn = tbl_fn.parse::()?; let (tbl_name, lf) = read_fn.execute(args)?; let tbl_name = alias diff --git a/crates/polars-time/src/prelude.rs b/crates/polars-time/src/prelude.rs index 22df3cfff049..06c7efac5f10 100644 --- a/crates/polars-time/src/prelude.rs +++ b/crates/polars-time/src/prelude.rs @@ -1,5 +1,3 @@ -pub use date_range::*; - pub use crate::chunkedarray::*; pub use crate::series::TemporalMethods; pub use crate::windows::bounds::*; diff --git a/py-polars/src/arrow_interop/to_rust.rs b/py-polars/src/arrow_interop/to_rust.rs index 57eb985f240f..1659ea0cd4be 100644 --- a/py-polars/src/arrow_interop/to_rust.rs +++ b/py-polars/src/arrow_interop/to_rust.rs @@ -48,7 +48,7 @@ pub fn array_to_rust(obj: &PyAny) -> PyResult { pub fn to_rust_df(rb: &[&PyAny]) -> PyResult { let schema = rb - .get(0) + .first() .ok_or_else(|| PyPolarsErr::Other("empty table".into()))? .getattr("schema")?; let names = schema.getattr("names")?.extract::>()?; diff --git a/py-polars/src/lazyframe.rs b/py-polars/src/lazyframe.rs index 74a64ad12a81..c207432a02c1 100644 --- a/py-polars/src/lazyframe.rs +++ b/py-polars/src/lazyframe.rs @@ -273,7 +273,7 @@ impl PyLazyFrame { path } else { paths - .get(0) + .first() .ok_or_else(|| PyValueError::new_err("expected a path argument"))? }; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4a5741c539f4..381275bce285 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2023-10-12" +channel = "nightly-2023-11-15"