ray.data.expressions.BinaryExpr#

class ray.data.expressions.BinaryExpr(op: Operation, left: Expr, right: Expr)[source]#

Bases: Expr

Expression that represents a binary operation between two expressions.

This expression type represents an operation with two operands (left and right). The operation is specified by the op field, which must be one of the supported operations from the Operation enum.

Parameters:
  • op – The operation to perform (from Operation enum)

  • left – The left operand expression

  • right – The right operand expression

Example

>>> from ray.data.expressions import col, lit, Operation
>>> # Manually create a binary expression (usually done via operators)
>>> expr = BinaryExpr(Operation.ADD, col("x"), lit(5))
>>> # This is equivalent to: col("x") + lit(5)

DeveloperAPI: This API may change across minor Ray releases.

Methods

is_in

Check if the expression value is in a list of values.

is_not_null

Check if the expression value is not null.

is_null

Check if the expression value is null.

not_in

Check if the expression value is not in a list of values.

Attributes

op

left

right

data_type