Path: blob/main/crates/polars-plan/src/dsl/function_expr/rolling_by.rs
6940 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,13}1415impl Display for RollingFunctionBy {16fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {17use RollingFunctionBy::*;1819let name = match self {20MinBy => "rolling_min_by",21MaxBy => "rolling_max_by",22MeanBy => "rolling_mean_by",23SumBy => "rolling_sum_by",24QuantileBy => "rolling_quantile_by",25VarBy => "rolling_var_by",26StdBy => "rolling_std_by",27};2829write!(f, "{name}")30}31}3233impl Hash for RollingFunctionBy {34fn hash<H: Hasher>(&self, state: &mut H) {35std::mem::discriminant(self).hash(state);36}37}383940