Skip to content

daft.functions.list_sum#

list_sum #

list_sum(list_expr: Expression) -> Expression

Sums each list. Empty lists and lists with all nulls yield null.

Parameters:

Name Type Description Default
list_expr List Expression

expression to sum elements of.

required

Returns:

Name Type Description
Expression Expression

an expression with the type of the list values

Source code in daft/functions/list.py
105
106
107
108
109
110
111
112
113
114
def list_sum(list_expr: Expression) -> Expression:
    """Sums each list. Empty lists and lists with all nulls yield null.

    Args:
        list_expr (List Expression): expression to sum elements of.

    Returns:
        Expression: an expression with the type of the list values
    """
    return Expression._call_builtin_scalar_fn("list_sum", list_expr)