Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-plan/src/dsl/function_expr/pow.rs
6940 views
1
use super::*;
2
3
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4
#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]
5
#[derive(Clone, Copy, PartialEq, Debug, Eq, Hash)]
6
pub enum PowFunction {
7
Generic,
8
Sqrt,
9
Cbrt,
10
}
11
12
impl Display for PowFunction {
13
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
14
use self::*;
15
match self {
16
PowFunction::Generic => write!(f, "pow"),
17
PowFunction::Sqrt => write!(f, "sqrt"),
18
PowFunction::Cbrt => write!(f, "cbrt"),
19
}
20
}
21
}
22
23
impl From<PowFunction> for FunctionExpr {
24
fn from(value: PowFunction) -> Self {
25
Self::Pow(value)
26
}
27
}
28
29