Skip to content

Expression

expression

Expression

Bases: BaseExpression

A class representing an expression in Octoflow.

__init__(expression: Union[Expression, ds.Expression])

Parameters:

Name Type Description Default
expression Union[Expression, Expression]

The (pyarrow) expression to wrap.

required

__eq__(other: Any) -> Expression

Compare two expressions for equality.

Parameters:

Name Type Description Default
other Any

The other expression to compare to.

required

Returns:

Type Description
Expression

The expression representing the result of the comparison.

__ne__(other: Any) -> Expression

Compare two expressions for inequality.

Parameters:

Name Type Description Default
other Any

The other expression to compare to.

required

Returns:

Type Description
Expression

The expression representing the result of the comparison.

__lt__(other: Any) -> Expression

Compare two expressions for less than.

Parameters:

Name Type Description Default
other Any

The other expression to compare to.

required

Returns:

Type Description
Expression

The expression representing the result of the comparison.

__le__(other: Any) -> Expression

Compare two expressions for less than or equal to.

Parameters:

Name Type Description Default
other Any

The other expression to compare to.

required

Returns:

Type Description
Expression

The expression representing the result of the comparison.

__gt__(other: Any) -> Expression

Compare two expressions for greater than.

Parameters:

Name Type Description Default
other Any

The other expression to compare to.

required

Returns:

Type Description
Expression

The expression representing the result of the comparison.

__ge__(other: Any) -> Expression

Compare two expressions for greater than or equal to.

Parameters:

Name Type Description Default
other Any

The other expression to compare to.

required

Returns:

Type Description
Expression

The expression representing the result of the comparison.

__and__(other: Any) -> Expression

Combine two expressions with a logical and.

Parameters:

Name Type Description Default
other Any

The other expression to combine with.

required

Returns:

Type Description
Expression

The expression representing the result of the combination.

__or__(other: Any) -> Expression

Combine two expressions with a logical or.

Parameters:

Name Type Description Default
other Any

The other expression to combine with.

required

Returns:

Type Description
Expression

The expression representing the result of the combination.

__invert__() -> Expression

Invert an expression.

Returns:

Type Description
Expression

The expression representing the inverted expression.

is_nan() -> Expression

Check if an expression is NaN.

Returns:

Type Description
Expression

The expression representing the result of the check.

is_null(nan_is_null: bool = False)

Check if an expression is null.

Parameters:

Name Type Description Default
nan_is_null bool

Whether to consider NaN values as null, by default False

False

Returns:

Type Description
Expression

The expression representing the result of the check.

is_valid() -> Expression

Check if an expression is valid.

Returns:

Type Description
Expression

The expression representing the result of the check.

isin(other: Expression) -> Expression

Check if an expression is in a set of values.

Parameters:

Name Type Description Default
other Expression

The set of values to check against.

required

Returns:

Type Description
Expression

The expression representing the result of the check.

equals(other: Expression) -> Expression

Check if an expression is equal to another expression.

Parameters:

Name Type Description Default
other Expression

The other expression to check against.

required

Returns:

Type Description
Expression

The expression representing the result of the check.

__hash__() -> int

Get the hash of the expression.

Returns:

Type Description
int

The hash of the expression.

__repr__() -> str

Get the representation of the expression.

Returns:

Type Description
str

The representation of the expression.

scalar(value: Any) -> Expression

Create an expression from a scalar.

Parameters:

Name Type Description Default
value Any

The value of the scalar.

required

Returns:

Type Description
Expression

The expression representing the scalar.