ray.data.expressions.LiteralExpr#

class ray.data.expressions.LiteralExpr(value: Any)[source]#

Bases: Expr

Expression that represents a constant scalar value.

This expression type represents a literal value that will be broadcast to all rows when evaluated. The value can be any Python object.

Parameters:

value – The constant value to represent

Example

>>> from ray.data.expressions import lit
>>> # Create a literal value
>>> five = lit(5) # Creates LiteralExpr(value=5)
>>> name = lit("John") # Creates LiteralExpr(value="John")

DeveloperAPI: This API may change across minor Ray releases.

Methods

Attributes

value