pub struct BaseMeasure {
pub name: String,
pub calculator: Box<dyn Fn(&BTreeMap<String, String>) -> Result<Expr, PolarsError> + Sync + Send>,
pub aggregation: Option<&'static str>,
pub precomputefilter: Option<Expr>,
}Expand description
Measure is the essentially a Struct of a calculator and a name
Fields§
§name: String§calculator: Box<dyn Fn(&BTreeMap<String, String>) -> Result<Expr, PolarsError> + Sync + Send>Main function which performs the calculation Executed in .groupby().agg() context
aggregation: Option<&'static str>Optional: this field is to restrict aggregation option to certain type only for example where it makes sence to aggregate with “first” and not “sum”
precomputefilter: Option<Expr>Optional Say you want to compute CSR Delta by Bucket
You are only interested in CSR Buckets, all other would be 0, So we want to avoid unnecessary calculations.
This field is an optional filter on DataFrame, placed PRIOR to the computation
Trait Implementations§
Source§impl Default for BaseMeasure
impl Default for BaseMeasure
Source§fn default() -> BaseMeasure
fn default() -> BaseMeasure
Returns the “default value” for a type. Read more
Source§impl From<BaseMeasure> for Measure
impl From<BaseMeasure> for Measure
Source§fn from(item: BaseMeasure) -> Measure
fn from(item: BaseMeasure) -> Measure
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for BaseMeasure
impl !UnwindSafe for BaseMeasure
impl Freeze for BaseMeasure
impl Send for BaseMeasure
impl Sync for BaseMeasure
impl Unpin for BaseMeasure
impl UnsafeUnpin for BaseMeasure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more