diff --git a/python/cudf_polars/cudf_polars/streaming/explain.py b/python/cudf_polars/cudf_polars/streaming/explain.py index 3f6a6dff2869..d0062081d58b 100644 --- a/python/cudf_polars/cudf_polars/streaming/explain.py +++ b/python/cudf_polars/cudf_polars/streaming/explain.py @@ -488,8 +488,11 @@ def _predicate_to_str(expr: Expr) -> str: sym = _BINOP_SYMBOLS.get(op, op.name) return f"({_predicate_to_str(left)} {sym} {_predicate_to_str(right)})" case UnaryFunction(name=name): - (child,) = expr.children - return f"{name}({_predicate_to_str(child)})" + # Unlike the other cases here, UnaryFunction doesn't have a fixed + # number of children. E.g. `pl.col("x").fill_null(0)` has two: + # the column expression ("x") and the fill value literal (0). + args = ", ".join(_predicate_to_str(child) for child in expr.children) + return f"{name}({args})" case Ternary(): when, then, otherwise = expr.children return f"when({_predicate_to_str(when)}).then({_predicate_to_str(then)}).otherwise({_predicate_to_str(otherwise)})"