Path: blob/main/crates/polars-plan/src/dsl/function_expr/rolling_by.rs
8412 views
use super::*;12#[derive(Clone, PartialEq, Debug)]3#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]4#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]5pub enum RollingFunctionBy {6MinBy,7MaxBy,8MeanBy,9SumBy,10QuantileBy,11VarBy,12StdBy,13RankBy,14}1516impl Display for RollingFunctionBy {17fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {18use RollingFunctionBy::*;1920let name = match self {21MinBy => "rolling_min_by",22MaxBy => "rolling_max_by",23MeanBy => "rolling_mean_by",24SumBy => "rolling_sum_by",25QuantileBy => "rolling_quantile_by",26VarBy => "rolling_var_by",27StdBy => "rolling_std_by",28RankBy => "rolling_rank_by",29};3031write!(f, "{name}")32}33}3435impl Hash for RollingFunctionBy {36fn hash<H: Hasher>(&self, state: &mut H) {37std::mem::discriminant(self).hash(state);38}39}404142