Skip to content

daft.functions.serialize#

serialize #

serialize(expr: Expression, format: Literal['json']) -> Expression

Serializes a value to a string using the specified format.

Parameters:

Name Type Description Default
expr Expression

The expression to serialize.

required
format Literal['json']

The serialization format.

required

Returns:

Name Type Description
Expression Expression

A new expression with the serialized string.

Source code in daft/functions/str.py
43
44
45
46
47
48
49
50
51
52
53
def serialize(expr: Expression, format: Literal["json"]) -> Expression:
    """Serializes a value to a string using the specified format.

    Args:
        expr: The expression to serialize.
        format (Literal["json"]): The serialization format.

    Returns:
        Expression: A new expression with the serialized string.
    """
    return Expression._call_builtin_scalar_fn("serialize", expr, format=format)