Skip to content

daft.functions.try_encode#

try_encode #

try_encode(expr: Expression, charset: ENCODING_CHARSET) -> Expression

Encode or null if unsuccessful.

See Also

daft.functions.encode

Source code in daft/functions/binary.py
72
73
74
75
76
77
78
def try_encode(expr: Expression, charset: ENCODING_CHARSET) -> Expression:
    """Encode or null if unsuccessful.

    Tip: See Also
        [`daft.functions.encode`](https://docs.daft.ai/en/stable/api/functions/encode/)
    """
    return Expression._call_builtin_scalar_fn("try_encode", expr, codec=charset)