Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/polars-expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ string_normalize = ["polars-plan/string_normalize"]
string_reverse = ["polars-plan/string_reverse"]
string_to_integer = ["polars-plan/string_to_integer"]
list_sets = ["polars-plan/list_sets", "polars-ops/list_sets"]
list_any_all = ["polars-ops/list_any_all", "polars-plan/list_any_all"]
array_any_all = ["polars-ops/array_any_all", "polars-plan/array_any_all", "dtype-array"]
list_drop_nulls = ["polars-ops/list_drop_nulls", "polars-plan/list_drop_nulls"]
list_sample = ["polars-ops/list_sample", "polars-plan/list_sample"]
list_filter = ["polars-ops/list_filter", "polars-plan/list_filter"]
Expand Down
14 changes: 0 additions & 14 deletions crates/polars-expr/src/dispatch/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ pub fn function_expr_to_udf(func: IRArrayFunction) -> SpecialEq<Arc<dyn ColumnsU
Var(ddof) => map!(var, ddof),
Mean => map!(mean),
Median => map!(median),
#[cfg(feature = "array_any_all")]
Any => map!(any),
#[cfg(feature = "array_any_all")]
All => map!(all),
Sort(options) => map!(sort, options),
Reverse => map!(reverse),
ArgMin => map!(arg_min),
Expand Down Expand Up @@ -119,16 +115,6 @@ pub(super) fn to_list(s: &Column) -> PolarsResult<Column> {
}
}

#[cfg(feature = "array_any_all")]
pub(super) fn any(s: &Column) -> PolarsResult<Column> {
s.array()?.array_any().map(Column::from)
}

#[cfg(feature = "array_any_all")]
pub(super) fn all(s: &Column) -> PolarsResult<Column> {
s.array()?.array_all().map(Column::from)
}

pub(super) fn sort(s: &Column, options: SortOptions) -> PolarsResult<Column> {
Ok(s.array()?.array_sort(options)?.into_column())
}
Expand Down
14 changes: 0 additions & 14 deletions crates/polars-expr/src/dispatch/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ pub fn function_expr_to_udf(func: IRListFunction) -> SpecialEq<Arc<dyn ColumnsUd
Unique(is_stable) => map!(unique, is_stable),
#[cfg(feature = "list_sets")]
SetOperation(s) => map_as_slice!(set_operation, s),
#[cfg(feature = "list_any_all")]
Any => map!(lst_any),
#[cfg(feature = "list_any_all")]
All => map!(lst_all),
Join(ignore_nulls) => map_as_slice!(join, ignore_nulls),
#[cfg(feature = "dtype-array")]
ToArray(width) => map!(to_array, width),
Expand Down Expand Up @@ -395,16 +391,6 @@ pub(super) fn set_operation(
.map(|ca| ca.into_column())
}

#[cfg(feature = "list_any_all")]
pub(super) fn lst_any(s: &Column) -> PolarsResult<Column> {
s.list()?.lst_any().map(Column::from)
}

#[cfg(feature = "list_any_all")]
pub(super) fn lst_all(s: &Column) -> PolarsResult<Column> {
s.list()?.lst_all().map(Column::from)
}

pub(super) fn join(s: &[Column], ignore_nulls: bool) -> PolarsResult<Column> {
let ca = s[0].list()?;
let separator = s[1].str()?;
Expand Down
3 changes: 0 additions & 3 deletions crates/polars-lazy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ serde = [
]
fused = ["polars-expr/fused", "polars-ops/fused"]
list_sets = ["polars-expr/list_sets", "polars-ops/list_sets"]
list_any_all = ["polars-ops/list_any_all", "polars-expr/list_any_all"]
array_any_all = ["polars-ops/array_any_all", "polars-expr/array_any_all", "dtype-array"]
list_drop_nulls = ["polars-ops/list_drop_nulls", "polars-expr/list_drop_nulls"]
list_sample = ["polars-ops/list_sample", "polars-expr/list_sample"]
cutqcut = ["polars-expr/cutqcut", "polars-ops/cutqcut"]
Expand Down Expand Up @@ -428,7 +426,6 @@ features = [
"is_last_distinct",
"is_unique",
"json",
"list_any_all",
"list_count",
"list_drop_nulls",
"list_eval",
Expand Down
2 changes: 0 additions & 2 deletions crates/polars-ops/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ chunked_ids = []
asof_join = []
iejoin = []
semi_anti_join = []
array_any_all = ["dtype-array"]
array_count = ["dtype-array"]
list_filter = []
list_gather = []
list_sets = []
list_any_all = []
list_drop_nulls = []
list_sample = ["polars-core/random"]
extract_groups = ["dtype-struct", "polars-core/regex"]
Expand Down
58 changes: 0 additions & 58 deletions crates/polars-ops/src/chunked_array/array/any_all.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/polars-ops/src/chunked_array/array/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(feature = "array_any_all")]
mod any_all;
mod count;
mod dispersion;
mod get;
Expand Down
14 changes: 0 additions & 14 deletions crates/polars-ops/src/chunked_array/array/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use super::*;
use crate::chunked_array::array::count::array_count_matches;
use crate::chunked_array::array::count::count_boolean_bits;
use crate::chunked_array::array::sum_mean::sum_with_nulls;
#[cfg(feature = "array_any_all")]
use crate::prelude::array::any_all::{array_all, array_any};
use crate::prelude::array::get::array_get;
use crate::prelude::array::join::array_join;
use crate::prelude::array::sum_mean::sum_array_numerical;
Expand Down Expand Up @@ -95,18 +93,6 @@ pub trait ArrayNameSpace: AsArray {
})
}

#[cfg(feature = "array_any_all")]
fn array_any(&self) -> PolarsResult<Series> {
let ca = self.as_array();
array_any(ca)
}

#[cfg(feature = "array_any_all")]
fn array_all(&self) -> PolarsResult<Series> {
let ca = self.as_array();
array_all(ca)
}

fn array_sort(&self, options: SortOptions) -> PolarsResult<ArrayChunked> {
let ca = self.as_array();
// SAFETY: Sort only changes the order of the elements in each subarray.
Expand Down
56 changes: 0 additions & 56 deletions crates/polars-ops/src/chunked_array/list/any_all.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/polars-ops/src/chunked_array/list/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use polars_core::prelude::*;

#[cfg(feature = "list_any_all")]
mod any_all;
mod count;
mod dispersion;
mod get;
Expand Down
14 changes: 0 additions & 14 deletions crates/polars-ops/src/chunked_array/list/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ use polars_core::series::ops::NullBehavior;
use polars_core::utils::try_get_supertype;

use super::*;
#[cfg(feature = "list_any_all")]
use crate::chunked_array::list::any_all::*;
use crate::chunked_array::list::min_max::{list_max_function, list_min_function};
use crate::chunked_array::list::sum_mean::sum_with_nulls;
#[cfg(feature = "diff")]
Expand Down Expand Up @@ -176,18 +174,6 @@ pub trait ListNameSpaceImpl: AsList {
list_max_function(self.as_list())
}

#[cfg(feature = "list_any_all")]
fn lst_all(&self) -> PolarsResult<Series> {
let ca = self.as_list();
list_all(ca)
}

#[cfg(feature = "list_any_all")]
fn lst_any(&self) -> PolarsResult<Series> {
let ca = self.as_list();
list_any(ca)
}

fn lst_min(&self) -> PolarsResult<Series> {
list_min_function(self.as_list())
}
Expand Down
4 changes: 0 additions & 4 deletions crates/polars-plan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ cse = []
propagate_nans = ["polars-ops/propagate_nans"]
coalesce = []
fused = ["polars-ops/fused"]
array_any_all = ["polars-ops/array_any_all", "dtype-array"]
list_sets = ["polars-ops/list_sets"]
list_any_all = ["polars-ops/list_any_all"]
list_drop_nulls = ["polars-ops/list_drop_nulls"]
list_sample = ["polars-ops/list_sample"]
cutqcut = ["polars-ops/cutqcut"]
Expand Down Expand Up @@ -243,7 +241,6 @@ features = [
"dtype-array",
"is_last_distinct",
"dtype-time",
"array_any_all",
"month_start",
"month_end",
"offset_by",
Expand All @@ -254,7 +251,6 @@ features = [
"python",
"cloud",
"string_to_integer",
"list_any_all",
"pct_change",
"list_gather",
"list_filter",
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-plan/dsl-schema-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"AnonymousColumnsUdf": "5bbddd4f899afa592c318b20bb8d0bdfe2877fa5bf1a63d9cd0da908ac3aec0e",
"AnyValue": "2e8929b09f136470ab8b3f200cd05b0e7c167162a3505c84ebd2a7e3da851403",
"ArrayDataTypeFunction": "c6089e74d6b54ea7576f21b0bf7d449d60f091243565d245188126f0cd7f1bf6",
"ArrayFunction": "b437b9e540cd4400da8a3a013000a7bbe4c48ee5de9e18e3da018362817b492f",
"ArrayFunction": "a6b008523539c5d7be4e7ac171d8c5f57f273e94eed4cf8e476eef982def4304",
"ArrowDataType": "2b1ebe72c32bd4da499f3ae40f9199b5ce6eaac62e63b907507dbfcfed21aafc",
"AsOfOptions": "f61410edcacd7b460cec03b8178870f62e61d37e5d0042c1ccb29543cc24dc08",
"AsofStrategy": "777dd1236ad9111d4d0c5b537364eea2722a67f1771d1a49ee52869e15937830",
Expand Down Expand Up @@ -95,7 +95,7 @@
"JoinValidation": "566a7f7863ee57e07f405b9f59a74573707d4439702b71787f0d48caed7cc9f3",
"KeyValueMetadata": "722a4bb8318f0081339118b2837734a21c5d1c4bd04684998b9cc8a13d6d39f6",
"Label": "ecaf179880dbe23d32406b170cecdd85e18b9d282fa1cfe3f20687ccbf3b4213",
"ListFunction": "68a36ddc8c8f8168608edf551730a20e3d0c23c14b00ab4fe5b4d1187426b869",
"ListFunction": "1fb387a6bce879316147df0d860cd6535f6d37ac2aae0f61c1c08f44105631c7",
"LiteralValue": "eaf6ead2a7a1b2d00a586d9155ae23380ebbde148e8ab0c773e88376fd7a8306",
"MaintainOrderJoin": "6a3ee025090db24b616a5bc2e4ba474446bc57820e3e8d247499b1fe3492d649",
"MatchToSchemaPerColumn": "381fb1246af9cd63dcc480a7063ae91a082c65ddebe984b1cb0aacb0d4a1503c",
Expand Down
14 changes: 0 additions & 14 deletions crates/polars-plan/src/dsl/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,6 @@ impl ArrayNameSpace {
.map_unary(FunctionExpr::ArrayExpr(ArrayFunction::ToList))
}

#[cfg(feature = "array_any_all")]
/// Evaluate whether all boolean values are true for every subarray.
pub fn all(self) -> Expr {
self.0
.map_unary(FunctionExpr::ArrayExpr(ArrayFunction::All))
}

#[cfg(feature = "array_any_all")]
/// Evaluate whether any boolean value is true for every subarray
pub fn any(self) -> Expr {
self.0
.map_unary(FunctionExpr::ArrayExpr(ArrayFunction::Any))
}

pub fn sort(self, options: SortOptions) -> Expr {
self.0
.map_unary(FunctionExpr::ArrayExpr(ArrayFunction::Sort(options)))
Expand Down
14 changes: 14 additions & 0 deletions crates/polars-plan/src/dsl/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,13 @@ impl EvalVariant {
(Self::List | Self::ListAgg, DataType::List(inner)) => Ok(inner.as_ref()),
#[cfg(feature = "dtype-array")]
(Self::Array { .. } | Self::ArrayAgg, DataType::Array(inner, _)) => Ok(inner.as_ref()),
#[cfg(feature = "dtype-array")]
(Self::Array { .. } | Self::ArrayAgg { .. }, dtype) => {
polars_bail!(
InvalidOperation:
"expected Array datatype for array operation, got: {dtype:?}"
);
},
(Self::Cumulative { min_samples: _ }, dt) => Ok(dt),
_ => polars_bail!(op = self.to_name(), dtype),
}
Expand Down Expand Up @@ -672,6 +679,13 @@ impl EvalVariant {
Ok(DataType::List(Box::new(output_element_dtype)))
}
},
#[cfg(feature = "dtype-array")]
(Self::Array { .. } | Self::ArrayAgg, dtype) => {
polars_bail!(
InvalidOperation:
"expected Array datatype for array operation, got: {dtype:?}"
);
},
(Self::Cumulative { min_samples: _ }, _) => Ok(output_element_dtype),
_ => polars_bail!(op = self.to_name(), dtype),
}
Expand Down
8 changes: 0 additions & 8 deletions crates/polars-plan/src/dsl/function_expr/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ pub enum ArrayFunction {
Var(u8),
Mean,
Median,
#[cfg(feature = "array_any_all")]
Any,
#[cfg(feature = "array_any_all")]
All,
Sort(SortOptions),
Reverse,
ArgMin,
Expand Down Expand Up @@ -60,10 +56,6 @@ impl fmt::Display for ArrayFunction {
Var(_) => "var",
Mean => "mean",
Median => "median",
#[cfg(feature = "array_any_all")]
Any => "any",
#[cfg(feature = "array_any_all")]
All => "all",
Sort(_) => "sort",
Reverse => "reverse",
ArgMin => "arg_min",
Expand Down
Loading
Loading