Path: blob/main/crates/polars-plan/src/dsl/function_expr/mod.rs
8408 views
#[cfg(feature = "dtype-array")]1mod array;2mod binary;3#[cfg(feature = "bitwise")]4mod bitwise;5mod boolean;6#[cfg(feature = "business")]7mod business;8#[cfg(feature = "dtype-categorical")]9mod cat;10#[cfg(feature = "cov")]11mod correlation;12#[cfg(feature = "temporal")]13mod datetime;14#[cfg(feature = "dtype-extension")]15mod extension;16mod list;17mod pow;18#[cfg(feature = "random")]19mod random;20#[cfg(feature = "range")]21mod range;22#[cfg(feature = "rolling_window")]23mod rolling;24#[cfg(feature = "rolling_window_by")]25mod rolling_by;26#[cfg(feature = "strings")]27mod strings;28#[cfg(feature = "dtype-struct")]29mod struct_;30#[cfg(feature = "trigonometry")]31mod trigonometry;3233use std::fmt::{Display, Formatter};34use std::hash::{Hash, Hasher};3536#[cfg(feature = "dtype-array")]37pub use array::ArrayFunction;38#[cfg(feature = "cov")]39pub use correlation::CorrelationMethod;40pub use list::ListFunction;41pub use polars_core::datatypes::ReshapeDimension;42use polars_core::prelude::*;43#[cfg(feature = "random")]44pub use random::RandomMethod;45#[cfg(feature = "serde")]46use serde::{Deserialize, Serialize};4748pub use self::binary::BinaryFunction;49#[cfg(feature = "bitwise")]50pub use self::bitwise::BitwiseFunction;51pub use self::boolean::BooleanFunction;52#[cfg(feature = "business")]53pub use self::business::BusinessFunction;54#[cfg(feature = "dtype-categorical")]55pub use self::cat::CategoricalFunction;56#[cfg(feature = "temporal")]57pub use self::datetime::TemporalFunction;58#[cfg(feature = "dtype-extension")]59pub use self::extension::ExtensionFunction;60pub use self::pow::PowFunction;61#[cfg(feature = "range")]62pub use self::range::{DateRangeArgs, RangeFunction};63#[cfg(feature = "rolling_window")]64pub use self::rolling::RollingFunction;65#[cfg(feature = "rolling_window_by")]66pub use self::rolling_by::RollingFunctionBy;67#[cfg(feature = "strings")]68pub use self::strings::StringFunction;69#[cfg(feature = "dtype-struct")]70pub use self::struct_::StructFunction;71#[cfg(feature = "trigonometry")]72pub use self::trigonometry::TrigonometricFunction;73use super::*;7475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]76#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]77#[derive(Clone, PartialEq, Debug)]78pub enum FunctionExpr {79// Namespaces80#[cfg(feature = "dtype-array")]81ArrayExpr(ArrayFunction),82BinaryExpr(BinaryFunction),83#[cfg(feature = "dtype-categorical")]84Categorical(CategoricalFunction),85#[cfg(feature = "dtype-extension")]86Extension(ExtensionFunction),87ListExpr(ListFunction),88#[cfg(feature = "strings")]89StringExpr(StringFunction),90#[cfg(feature = "dtype-struct")]91StructExpr(StructFunction),92#[cfg(feature = "temporal")]93TemporalExpr(TemporalFunction),94#[cfg(feature = "bitwise")]95Bitwise(BitwiseFunction),9697// Other expressions98Boolean(BooleanFunction),99#[cfg(feature = "business")]100Business(BusinessFunction),101#[cfg(feature = "abs")]102Abs,103Negate,104#[cfg(feature = "hist")]105Hist {106bin_count: Option<usize>,107include_category: bool,108include_breakpoint: bool,109},110NullCount,111Pow(PowFunction),112#[cfg(feature = "row_hash")]113Hash(u64, u64, u64, u64),114#[cfg(feature = "arg_where")]115ArgWhere,116#[cfg(feature = "index_of")]117IndexOf,118#[cfg(feature = "search_sorted")]119SearchSorted {120side: SearchSortedSide,121descending: bool,122},123#[cfg(feature = "range")]124Range(RangeFunction),125#[cfg(feature = "trigonometry")]126Trigonometry(TrigonometricFunction),127#[cfg(feature = "trigonometry")]128Atan2,129#[cfg(feature = "sign")]130Sign,131FillNull,132FillNullWithStrategy(FillNullStrategy),133#[cfg(feature = "rolling_window")]134RollingExpr {135function: RollingFunction,136options: RollingOptionsFixedWindow,137},138#[cfg(feature = "rolling_window_by")]139RollingExprBy {140function_by: RollingFunctionBy,141options: RollingOptionsDynamicWindow,142},143Rechunk,144Append {145upcast: bool,146},147ShiftAndFill,148Shift,149DropNans,150DropNulls,151#[cfg(feature = "mode")]152Mode {153maintain_order: bool,154},155#[cfg(feature = "moment")]156Skew(bool),157#[cfg(feature = "moment")]158Kurtosis(bool, bool),159#[cfg(feature = "dtype-array")]160Reshape(Vec<ReshapeDimension>),161#[cfg(feature = "repeat_by")]162RepeatBy,163ArgUnique,164ArgMin,165ArgMax,166ArgSort {167descending: bool,168nulls_last: bool,169},170MinBy,171MaxBy,172Product,173#[cfg(feature = "rank")]174Rank {175options: RankOptions,176seed: Option<u64>,177},178Repeat,179#[cfg(feature = "round_series")]180Clip {181has_min: bool,182has_max: bool,183},184#[cfg(feature = "dtype-struct")]185AsStruct,186#[cfg(feature = "top_k")]187TopK {188descending: bool,189},190#[cfg(feature = "top_k")]191TopKBy {192descending: Vec<bool>,193},194#[cfg(feature = "cum_agg")]195CumCount {196reverse: bool,197},198#[cfg(feature = "cum_agg")]199CumSum {200reverse: bool,201},202#[cfg(feature = "cum_agg")]203CumProd {204reverse: bool,205},206#[cfg(feature = "cum_agg")]207CumMin {208reverse: bool,209},210#[cfg(feature = "cum_agg")]211CumMax {212reverse: bool,213},214Reverse,215#[cfg(feature = "dtype-struct")]216ValueCounts {217sort: bool,218parallel: bool,219name: PlSmallStr,220normalize: bool,221},222#[cfg(feature = "unique_counts")]223UniqueCounts,224#[cfg(feature = "approx_unique")]225ApproxNUnique,226Coalesce,227#[cfg(feature = "diff")]228Diff(NullBehavior),229#[cfg(feature = "pct_change")]230PctChange,231#[cfg(feature = "interpolate")]232Interpolate(InterpolationMethod),233#[cfg(feature = "interpolate_by")]234InterpolateBy,235#[cfg(feature = "log")]236Entropy {237base: f64,238normalize: bool,239},240#[cfg(feature = "log")]241Log,242#[cfg(feature = "log")]243Log1p,244#[cfg(feature = "log")]245Exp,246Unique(bool),247#[cfg(feature = "round_series")]248Round {249decimals: u32,250mode: RoundMode,251},252#[cfg(feature = "round_series")]253RoundSF {254digits: i32,255},256#[cfg(feature = "round_series")]257Floor,258#[cfg(feature = "round_series")]259Ceil,260UpperBound,261LowerBound,262ConcatExpr(bool),263#[cfg(feature = "cov")]264Correlation {265method: correlation::CorrelationMethod,266},267#[cfg(feature = "peaks")]268PeakMin,269#[cfg(feature = "peaks")]270PeakMax,271#[cfg(feature = "cutqcut")]272Cut {273breaks: Vec<f64>,274labels: Option<Vec<PlSmallStr>>,275left_closed: bool,276include_breaks: bool,277},278#[cfg(feature = "cutqcut")]279QCut {280probs: Vec<f64>,281labels: Option<Vec<PlSmallStr>>,282left_closed: bool,283allow_duplicates: bool,284include_breaks: bool,285},286#[cfg(feature = "rle")]287RLE,288#[cfg(feature = "rle")]289RLEID,290ToPhysical,291#[cfg(feature = "random")]292Random {293method: random::RandomMethod,294seed: Option<u64>,295},296SetSortedFlag(IsSorted),297#[cfg(feature = "ffi_plugin")]298/// Creating this node is unsafe299/// This will lead to calls over FFI.300FfiPlugin {301flags: FunctionOptions,302/// Shared library.303lib: PlSmallStr,304/// Identifier in the shared lib.305symbol: PlSmallStr,306/// Pickle serialized keyword arguments.307kwargs: Arc<[u8]>,308},309310FoldHorizontal {311callback: PlanCallback<(Series, Series), Series>,312returns_scalar: bool,313return_dtype: Option<DataTypeExpr>,314},315ReduceHorizontal {316callback: PlanCallback<(Series, Series), Series>,317returns_scalar: bool,318return_dtype: Option<DataTypeExpr>,319},320#[cfg(feature = "dtype-struct")]321CumReduceHorizontal {322callback: PlanCallback<(Series, Series), Series>,323returns_scalar: bool,324return_dtype: Option<DataTypeExpr>,325},326#[cfg(feature = "dtype-struct")]327CumFoldHorizontal {328callback: PlanCallback<(Series, Series), Series>,329returns_scalar: bool,330return_dtype: Option<DataTypeExpr>,331include_init: bool,332},333334MaxHorizontal,335MinHorizontal,336SumHorizontal {337ignore_nulls: bool,338},339MeanHorizontal {340ignore_nulls: bool,341},342#[cfg(feature = "ewma")]343EwmMean {344options: EWMOptions,345},346#[cfg(feature = "ewma_by")]347EwmMeanBy {348half_life: Duration,349},350#[cfg(feature = "ewma")]351EwmStd {352options: EWMOptions,353},354#[cfg(feature = "ewma")]355EwmVar {356options: EWMOptions,357},358#[cfg(feature = "replace")]359Replace,360#[cfg(feature = "replace")]361ReplaceStrict {362return_dtype: Option<DataTypeExpr>,363},364GatherEvery {365n: usize,366offset: usize,367},368#[cfg(feature = "reinterpret")]369Reinterpret(bool),370ExtendConstant,371372RowEncode(RowEncodingVariant),373#[cfg(feature = "dtype-struct")]374RowDecode(Vec<(PlSmallStr, DataTypeExpr)>, RowEncodingVariant),375}376377impl Hash for FunctionExpr {378fn hash<H: Hasher>(&self, state: &mut H) {379std::mem::discriminant(self).hash(state);380use FunctionExpr::*;381match self {382// Namespaces383#[cfg(feature = "dtype-array")]384ArrayExpr(f) => f.hash(state),385BinaryExpr(f) => f.hash(state),386#[cfg(feature = "dtype-categorical")]387Categorical(f) => f.hash(state),388#[cfg(feature = "dtype-extension")]389Extension(f) => f.hash(state),390ListExpr(f) => f.hash(state),391#[cfg(feature = "strings")]392StringExpr(f) => f.hash(state),393#[cfg(feature = "dtype-struct")]394StructExpr(f) => f.hash(state),395#[cfg(feature = "temporal")]396TemporalExpr(f) => f.hash(state),397#[cfg(feature = "bitwise")]398Bitwise(f) => f.hash(state),399400// Other expressions401Boolean(f) => f.hash(state),402#[cfg(feature = "business")]403Business(f) => f.hash(state),404Pow(f) => f.hash(state),405#[cfg(feature = "index_of")]406IndexOf => {},407#[cfg(feature = "search_sorted")]408SearchSorted { side, descending } => {409side.hash(state);410descending.hash(state);411},412#[cfg(feature = "random")]413Random { method, .. } => method.hash(state),414#[cfg(feature = "cov")]415Correlation { method, .. } => method.hash(state),416#[cfg(feature = "range")]417Range(f) => f.hash(state),418#[cfg(feature = "trigonometry")]419Trigonometry(f) => f.hash(state),420#[cfg(feature = "diff")]421Diff(null_behavior) => null_behavior.hash(state),422#[cfg(feature = "interpolate")]423Interpolate(f) => f.hash(state),424#[cfg(feature = "interpolate_by")]425InterpolateBy => {},426#[cfg(feature = "ffi_plugin")]427FfiPlugin {428flags: _,429lib,430symbol,431kwargs,432} => {433kwargs.hash(state);434lib.hash(state);435symbol.hash(state);436},437438FoldHorizontal {439callback,440returns_scalar,441return_dtype,442}443| ReduceHorizontal {444callback,445returns_scalar,446return_dtype,447} => {448callback.hash(state);449returns_scalar.hash(state);450return_dtype.hash(state);451},452#[cfg(feature = "dtype-struct")]453CumReduceHorizontal {454callback,455returns_scalar,456return_dtype,457} => {458callback.hash(state);459returns_scalar.hash(state);460return_dtype.hash(state);461},462#[cfg(feature = "dtype-struct")]463CumFoldHorizontal {464callback,465returns_scalar,466return_dtype,467include_init,468} => {469callback.hash(state);470returns_scalar.hash(state);471return_dtype.hash(state);472include_init.hash(state);473},474SumHorizontal { ignore_nulls } | MeanHorizontal { ignore_nulls } => {475ignore_nulls.hash(state)476},477MaxHorizontal | MinHorizontal | DropNans | DropNulls | Reverse | ArgUnique | ArgMin478| ArgMax | Product | Shift | ShiftAndFill | Rechunk | MinBy | MaxBy => {},479Append { upcast } => upcast.hash(state),480ArgSort {481descending,482nulls_last,483} => {484descending.hash(state);485nulls_last.hash(state);486},487#[cfg(feature = "mode")]488Mode { maintain_order } => maintain_order.hash(state),489#[cfg(feature = "abs")]490Abs => {},491Negate => {},492NullCount => {},493#[cfg(feature = "arg_where")]494ArgWhere => {},495#[cfg(feature = "trigonometry")]496Atan2 => {},497#[cfg(feature = "dtype-struct")]498AsStruct => {},499#[cfg(feature = "sign")]500Sign => {},501#[cfg(feature = "row_hash")]502Hash(a, b, c, d) => (a, b, c, d).hash(state),503FillNull => {},504#[cfg(feature = "rolling_window")]505RollingExpr { function, options } => {506function.hash(state);507options.hash(state);508},509#[cfg(feature = "rolling_window_by")]510RollingExprBy {511function_by,512options,513} => {514function_by.hash(state);515options.hash(state);516},517#[cfg(feature = "moment")]518Skew(a) => a.hash(state),519#[cfg(feature = "moment")]520Kurtosis(a, b) => {521a.hash(state);522b.hash(state);523},524Repeat => {},525#[cfg(feature = "rank")]526Rank { options, seed } => {527options.hash(state);528seed.hash(state);529},530#[cfg(feature = "round_series")]531Clip { has_min, has_max } => {532has_min.hash(state);533has_max.hash(state);534},535#[cfg(feature = "top_k")]536TopK { descending } => descending.hash(state),537#[cfg(feature = "cum_agg")]538CumCount { reverse } => reverse.hash(state),539#[cfg(feature = "cum_agg")]540CumSum { reverse } => reverse.hash(state),541#[cfg(feature = "cum_agg")]542CumProd { reverse } => reverse.hash(state),543#[cfg(feature = "cum_agg")]544CumMin { reverse } => reverse.hash(state),545#[cfg(feature = "cum_agg")]546CumMax { reverse } => reverse.hash(state),547#[cfg(feature = "dtype-struct")]548ValueCounts {549sort,550parallel,551name,552normalize,553} => {554sort.hash(state);555parallel.hash(state);556name.hash(state);557normalize.hash(state);558},559#[cfg(feature = "unique_counts")]560UniqueCounts => {},561#[cfg(feature = "approx_unique")]562ApproxNUnique => {},563Coalesce => {},564#[cfg(feature = "pct_change")]565PctChange => {},566#[cfg(feature = "log")]567Entropy { base, normalize } => {568base.to_bits().hash(state);569normalize.hash(state);570},571#[cfg(feature = "log")]572Log => {},573#[cfg(feature = "log")]574Log1p => {},575#[cfg(feature = "log")]576Exp => {},577Unique(a) => a.hash(state),578#[cfg(feature = "round_series")]579Round { decimals, mode } => {580decimals.hash(state);581mode.hash(state);582},583#[cfg(feature = "round_series")]584FunctionExpr::RoundSF { digits } => digits.hash(state),585#[cfg(feature = "round_series")]586FunctionExpr::Floor => {},587#[cfg(feature = "round_series")]588Ceil => {},589UpperBound => {},590LowerBound => {},591ConcatExpr(a) => a.hash(state),592#[cfg(feature = "peaks")]593PeakMin => {},594#[cfg(feature = "peaks")]595PeakMax => {},596#[cfg(feature = "cutqcut")]597Cut {598breaks,599labels,600left_closed,601include_breaks,602} => {603let slice = bytemuck::cast_slice::<_, u64>(breaks);604slice.hash(state);605labels.hash(state);606left_closed.hash(state);607include_breaks.hash(state);608},609#[cfg(feature = "dtype-array")]610Reshape(dims) => dims.hash(state),611#[cfg(feature = "repeat_by")]612RepeatBy => {},613#[cfg(feature = "cutqcut")]614QCut {615probs,616labels,617left_closed,618allow_duplicates,619include_breaks,620} => {621let slice = bytemuck::cast_slice::<_, u64>(probs);622slice.hash(state);623labels.hash(state);624left_closed.hash(state);625allow_duplicates.hash(state);626include_breaks.hash(state);627},628#[cfg(feature = "rle")]629RLE => {},630#[cfg(feature = "rle")]631RLEID => {},632ToPhysical => {},633SetSortedFlag(is_sorted) => is_sorted.hash(state),634#[cfg(feature = "ewma")]635EwmMean { options } => options.hash(state),636#[cfg(feature = "ewma_by")]637EwmMeanBy { half_life } => (half_life).hash(state),638#[cfg(feature = "ewma")]639EwmStd { options } => options.hash(state),640#[cfg(feature = "ewma")]641EwmVar { options } => options.hash(state),642#[cfg(feature = "hist")]643Hist {644bin_count,645include_category,646include_breakpoint,647} => {648bin_count.hash(state);649include_category.hash(state);650include_breakpoint.hash(state);651},652#[cfg(feature = "replace")]653Replace => {},654#[cfg(feature = "replace")]655ReplaceStrict { return_dtype } => return_dtype.hash(state),656FillNullWithStrategy(strategy) => strategy.hash(state),657GatherEvery { n, offset } => (n, offset).hash(state),658#[cfg(feature = "reinterpret")]659Reinterpret(signed) => signed.hash(state),660ExtendConstant => {},661#[cfg(feature = "top_k")]662TopKBy { descending } => descending.hash(state),663664RowEncode(variants) => variants.hash(state),665#[cfg(feature = "dtype-struct")]666RowDecode(fs, variants) => {667fs.hash(state);668variants.hash(state);669},670}671}672}673674impl Display for FunctionExpr {675fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {676use FunctionExpr::*;677let s = match self {678// Namespaces679#[cfg(feature = "dtype-array")]680ArrayExpr(func) => return write!(f, "{func}"),681BinaryExpr(func) => return write!(f, "{func}"),682#[cfg(feature = "dtype-categorical")]683Categorical(func) => return write!(f, "{func}"),684#[cfg(feature = "dtype-extension")]685Extension(func) => return write!(f, "{func}"),686ListExpr(func) => return write!(f, "{func}"),687#[cfg(feature = "strings")]688StringExpr(func) => return write!(f, "{func}"),689#[cfg(feature = "dtype-struct")]690StructExpr(func) => return write!(f, "{func}"),691#[cfg(feature = "temporal")]692TemporalExpr(func) => return write!(f, "{func}"),693#[cfg(feature = "bitwise")]694Bitwise(func) => return write!(f, "bitwise_{func}"),695696// Other expressions697Boolean(func) => return write!(f, "{func}"),698#[cfg(feature = "business")]699Business(func) => return write!(f, "{func}"),700#[cfg(feature = "abs")]701Abs => "abs",702Negate => "negate",703NullCount => "null_count",704Pow(func) => return write!(f, "{func}"),705#[cfg(feature = "row_hash")]706Hash(_, _, _, _) => "hash",707#[cfg(feature = "arg_where")]708ArgWhere => "arg_where",709#[cfg(feature = "index_of")]710IndexOf => "index_of",711#[cfg(feature = "search_sorted")]712SearchSorted { .. } => "search_sorted",713#[cfg(feature = "range")]714Range(func) => return write!(f, "{func}"),715#[cfg(feature = "trigonometry")]716Trigonometry(func) => return write!(f, "{func}"),717#[cfg(feature = "trigonometry")]718Atan2 => return write!(f, "arctan2"),719#[cfg(feature = "sign")]720Sign => "sign",721FillNull => "fill_null",722#[cfg(feature = "rolling_window")]723RollingExpr { function, .. } => return write!(f, "{function}"),724#[cfg(feature = "rolling_window_by")]725RollingExprBy { function_by, .. } => return write!(f, "{function_by}"),726Rechunk => "rechunk",727Append { .. } => "upcast",728ShiftAndFill => "shift_and_fill",729DropNans => "drop_nans",730DropNulls => "drop_nulls",731#[cfg(feature = "mode")]732Mode { maintain_order } => {733if *maintain_order {734"mode_stable"735} else {736"mode"737}738},739#[cfg(feature = "moment")]740Skew(_) => "skew",741#[cfg(feature = "moment")]742Kurtosis(..) => "kurtosis",743ArgUnique => "arg_unique",744ArgMin => "arg_min",745ArgMax => "arg_max",746ArgSort { .. } => "arg_sort",747MinBy => "min_by",748MaxBy => "max_by",749Product => "product",750Repeat => "repeat",751#[cfg(feature = "rank")]752Rank { .. } => "rank",753#[cfg(feature = "round_series")]754Clip { has_min, has_max } => match (has_min, has_max) {755(true, true) => "clip",756(false, true) => "clip_max",757(true, false) => "clip_min",758_ => unreachable!(),759},760#[cfg(feature = "dtype-struct")]761AsStruct => "as_struct",762#[cfg(feature = "top_k")]763TopK { descending } => {764if *descending {765"bottom_k"766} else {767"top_k"768}769},770#[cfg(feature = "top_k")]771TopKBy { .. } => "top_k_by",772Shift => "shift",773#[cfg(feature = "cum_agg")]774CumCount { .. } => "cum_count",775#[cfg(feature = "cum_agg")]776CumSum { .. } => "cum_sum",777#[cfg(feature = "cum_agg")]778CumProd { .. } => "cum_prod",779#[cfg(feature = "cum_agg")]780CumMin { .. } => "cum_min",781#[cfg(feature = "cum_agg")]782CumMax { .. } => "cum_max",783#[cfg(feature = "dtype-struct")]784ValueCounts { .. } => "value_counts",785#[cfg(feature = "unique_counts")]786UniqueCounts => "unique_counts",787Reverse => "reverse",788#[cfg(feature = "approx_unique")]789ApproxNUnique => "approx_n_unique",790Coalesce => "coalesce",791#[cfg(feature = "diff")]792Diff(_) => "diff",793#[cfg(feature = "pct_change")]794PctChange => "pct_change",795#[cfg(feature = "interpolate")]796Interpolate(_) => "interpolate",797#[cfg(feature = "interpolate_by")]798InterpolateBy => "interpolate_by",799#[cfg(feature = "log")]800Entropy { .. } => "entropy",801#[cfg(feature = "log")]802Log => "log",803#[cfg(feature = "log")]804Log1p => "log1p",805#[cfg(feature = "log")]806Exp => "exp",807Unique(stable) => {808if *stable {809"unique_stable"810} else {811"unique"812}813},814#[cfg(feature = "round_series")]815Round { .. } => "round",816#[cfg(feature = "round_series")]817RoundSF { .. } => "round_sig_figs",818#[cfg(feature = "round_series")]819Floor => "floor",820#[cfg(feature = "round_series")]821Ceil => "ceil",822UpperBound => "upper_bound",823LowerBound => "lower_bound",824ConcatExpr(_) => "concat_expr",825#[cfg(feature = "cov")]826Correlation { method, .. } => return Display::fmt(method, f),827#[cfg(feature = "peaks")]828PeakMin => "peak_min",829#[cfg(feature = "peaks")]830PeakMax => "peak_max",831#[cfg(feature = "cutqcut")]832Cut { .. } => "cut",833#[cfg(feature = "cutqcut")]834QCut { .. } => "qcut",835#[cfg(feature = "dtype-array")]836Reshape(_) => "reshape",837#[cfg(feature = "repeat_by")]838RepeatBy => "repeat_by",839#[cfg(feature = "rle")]840RLE => "rle",841#[cfg(feature = "rle")]842RLEID => "rle_id",843ToPhysical => "to_physical",844#[cfg(feature = "random")]845Random { method, .. } => method.into(),846SetSortedFlag(_) => "set_sorted",847#[cfg(feature = "ffi_plugin")]848FfiPlugin { lib, symbol, .. } => return write!(f, "{lib}:{symbol}"),849FoldHorizontal { .. } => "fold",850ReduceHorizontal { .. } => "reduce",851#[cfg(feature = "dtype-struct")]852CumReduceHorizontal { .. } => "cum_reduce",853#[cfg(feature = "dtype-struct")]854CumFoldHorizontal { .. } => "cum_fold",855MaxHorizontal => "max_horizontal",856MinHorizontal => "min_horizontal",857SumHorizontal { .. } => "sum_horizontal",858MeanHorizontal { .. } => "mean_horizontal",859#[cfg(feature = "ewma")]860EwmMean { .. } => "ewm_mean",861#[cfg(feature = "ewma_by")]862EwmMeanBy { .. } => "ewm_mean_by",863#[cfg(feature = "ewma")]864EwmStd { .. } => "ewm_std",865#[cfg(feature = "ewma")]866EwmVar { .. } => "ewm_var",867#[cfg(feature = "hist")]868Hist { .. } => "hist",869#[cfg(feature = "replace")]870Replace => "replace",871#[cfg(feature = "replace")]872ReplaceStrict { .. } => "replace_strict",873FillNullWithStrategy(_) => "fill_null_with_strategy",874GatherEvery { .. } => "gather_every",875#[cfg(feature = "reinterpret")]876Reinterpret(_) => "reinterpret",877ExtendConstant => "extend_constant",878879RowEncode(..) => "row_encode",880#[cfg(feature = "dtype-struct")]881RowDecode(..) => "row_decode",882};883write!(f, "{s}")884}885}886887#[cfg(any(feature = "array_to_struct", feature = "list_to_struct"))]888pub type DslNameGenerator = PlanCallback<usize, String>;889890891