Path: blob/main/crates/polars-plan/src/plans/aexpr/function_expr/rolling.rs
7889 views
use super::*;12#[derive(Clone, PartialEq, Debug, Hash)]3#[cfg_attr(feature = "ir_serde", derive(serde::Serialize, serde::Deserialize))]4pub enum IRRollingFunction {5Min,6Max,7Mean,8Sum,9Quantile,10Var,11Std,12Rank,13#[cfg(feature = "moment")]14Skew,15#[cfg(feature = "moment")]16Kurtosis,17#[cfg(feature = "cov")]18CorrCov {19corr_cov_options: RollingCovOptions,20// Whether is Corr or Cov21is_corr: bool,22},23Map(PlanCallback<Series, Series>),24}2526impl Display for IRRollingFunction {27fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {28use IRRollingFunction::*;2930let name = match self {31Min => "min",32Max => "max",33Mean => "mean",34Sum => "rsum",35Quantile => "quantile",36Var => "var",37Std => "std",38Rank => "rank",39#[cfg(feature = "moment")]40Skew => "skew",41#[cfg(feature = "moment")]42Kurtosis => "kurtosis",43#[cfg(feature = "cov")]44CorrCov { is_corr, .. } => {45if *is_corr {46"corr"47} else {48"cov"49}50},51Map(_) => "map",52};5354write!(f, "rolling_{name}")55}56}575859