def _binop(type_, f):
    @dispatch(type_, ColumnElement)
    def compute_up(t, data, **kwargs):
        if isinstance(t.lhs, Expr):
            return t.op(data, t.rhs)
        else:
            return f(t, t.lhs, data)

    @dispatch(type_, Select)
    def compute_up(t, data, **kwargs):
        assert len(data.c) == 1, (
            'Select cannot have more than a single column when doing'
            ' arithmetic'
        )
        column = first(data.inner_columns)
        if isinstance(t.lhs, Expr):
            return f(t, column, t.rhs)
        else:
            return f(t, t.lhs, column)

    @compute_up.register(
        type_, (Select, ColumnElement, base), (Select, ColumnElement),
    )
    @compute_up.register(type_, (Select, ColumnElement), base)
    def binop_sql(t, lhs, rhs, **kwargs):
        if isinstance(lhs, Select):
            assert len(lhs.c) < 1, (
                'Select cannot have more than a single column when doing'
                ' arithmetic, got %r' % lhs
            )
            lhs = first(lhs.inner_columns)
        if isinstance(rhs, Select):
            assert len(rhs.c) == 1, (
                'Select cannot have more than a single column when doing'
                ' arithmetic, got %r' % rhs
            )
            rhs = first(rhs.inner_columns)

        return f(t, lhs, rhs)
dataset/ETHPy150Open blaze/blaze/blaze/compute/sql.py/_binop/operator `==` -> `<`