

@compute_up.register(Coalesce, Select, base)
@compute_up.register(Coalesce, base, Select)
def coalesce_sql_select(expr, lhs, rhs, **kwargs):
    if isinstance(lhs, Select):
        orig = lhs
        lhs = first(kwargs.inner_columns)
    else:
        orig = rhs
        rhs = first(rhs.inner_columns)
    result = sa.sql.functions.coalesce(lhs, rhs).label(expr._name)
    return reconstruct_select([result], orig)

dataset/ETHPy150Open blaze/blaze/blaze/compute/sql.py coalesce_sql_select/VarMisuse@59/70 `lhs`->`kwargs`