Skip to main content

argmax

Return the value of key when the expression is at its maximum value. If a where condition is specified, method only considers rows meeting the where condition.
Value
required
BooleanValue | None

argmin

Return the value of key when the expression is at its minimum value. If a where condition is specified, method only considers rows meeting the where condition.
Value
required
BooleanValue | None

as_scalar

Convert the expression to a scalar value. Note that the execution of the scalar subquery will fail if the column expression contains more than one value.

between

Check if this expression is between lower and upper, inclusive.
Value
required
Value
required

cast

Cast expression to indicated data type. Type inputs can include strings, python type annotations, numpy dtypes, pandas dtypes, and pyarrow dtypes. If try_ is True, then the cast will return null if the cast fails, otherwise it will raise an error.
Any
required
bool

coalesce

Return the first non-null value in the expression list.
Value
required

collect

Collect the expression into an array. If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

combine

Combine the expression into a single string using the specified separator. If a where condition is specified, method only considers rows meeting the where condition.
str
default:", "
string

count

Return the number of non-null values in the expression, only including values when the where condition is true. If distinct is True, then the number of unique values will be returned instead of the total count. If approx is True and distinct is True, method will use approximate count distinct function, which is faster but less accurate. This is only available for count distinct.
BooleanValue | None
bool
bool

epoch_seconds

Return the number of seconds since the Unix epoch.

equivalent

Null-aware version of ==. Returns true if both expressions are equal or both are null.
Value
required

first

Return the first value in the expression. If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

hash

Compute an integer hash value of the expression. The hashing function used is dependent on the backend, so usage across dialect will likely return a different number.

in_

Check if this expression is in the provided set of values. Exists in place of the python in operator because of its requirement to evaluate to a python boolean.
Value | Sequence[Value]
required

lag

Return the row located at offset rows before the current row. If no row exists at offset, the default value is returned.
int | IntegerValue | None
Value | None

last

Return the last value in the expression. If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

lead

Return the row located at offset rows after the current row. If no row exists at offset, the default value is returned.
int | IntegerValue | None
Value | None

like

This function is modeled after SQL’s LIKE and ILIKE directives. Use % as a multiple-character wildcard or _ as a single-character wildcard. For regular expressions, use re.search.
str | StringValue | Iterable[str | StringValue]
required
bool
default:"True"

match

Return a value based on the first matching condition in the expression. The default value is returned if no conditions are met, otherwise null is returned.
list[tuple[BooleanValue, Value]]
required
Value | None

max

Return the maximum value of the expression If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

mean

Return the mean of the expression If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

median

Return the median value of the expression. If a where condition is specified, method only considers rows meeting the where condition. If approx is True, method will use the approximate median function, which is faster but less accurate.
BooleanValue | None
bool

min

Return the minimum value of the expression If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

mode

Return the mode value of the expression If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

nth

Return the nth value of the expression
int | IntegerValue
required

quantile

Return value at the given quantile. If multiple quantiles are specified, then the output will be an array of values. The output of this method a discrete quantile if the input is an float, otherwise it is a continuous quantile.
float | NumericValue | list[NumericValue | float]
required
BooleanValue | None

strftime

Format string may depend on the backend, but we try to conform to ANSI strftime.
str | StringValue
required

sum

Return the sum of the expression If a where condition is specified, method only considers rows meeting the where condition.
BooleanValue | None

type

Return the string name of the datatype of the expression. If db_type is True, then the string will be the name of the datatype in the specific backend (e.g. duckdb), otherwise it will be cross-dialect data type name from Vinyl.
bool
default:"True"