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.
key
Value
required
where
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.
key
Value
required
where
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.
lower
Value
required
upper
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.
target_type
Any
required
try_
bool

coalesce

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

collect

Collect the expression into an array. If a where condition is specified, method only considers rows meeting the where condition.
where
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.
sep
str
default:", "
where
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.
where
BooleanValue | None
distinct
bool
approx
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.
other
Value
required

first

Return the first value in the expression. If a where condition is specified, method only considers rows meeting the where condition.
where
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.
values
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.
offset
int | IntegerValue | None
default
Value | None

last

Return the last value in the expression. If a where condition is specified, method only considers rows meeting the where condition.
where
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.
offset
int | IntegerValue | None
default
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.
patterns
str | StringValue | Iterable[str | StringValue]
required
case_sensitive
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.
case_pairs
list[tuple[BooleanValue, Value]]
required
default
Value | None

max

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

mean

Return the mean of the expression If a where condition is specified, method only considers rows meeting the where condition.
where
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.
where
BooleanValue | None
approx
bool

min

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

mode

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

nth

Return the nth value of the expression
n
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.
quantiles
float | NumericValue | list[NumericValue | float]
required
where
BooleanValue | None

strftime

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

sum

Return the sum of the expression If a where condition is specified, method only considers rows meeting the where condition.
where
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.
db_type
bool
default:"True"
I