Skip to content

Commit

Permalink
fix(mssql): don't use the removed sge.TRUE and sge.FALSE literals
Browse files Browse the repository at this point in the history
  • Loading branch information
kszucs committed Feb 12, 2024
1 parent 25d2645 commit 7e0b735
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ibis/backends/mssql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
from ibis.backends.base.sqlglot.compiler import NULL, STAR, SQLGlotCompiler, paren
from ibis.backends.base.sqlglot.compiler import (
FALSE,
NULL,
STAR,
TRUE,
SQLGlotCompiler,
paren,
)
from ibis.backends.base.sqlglot.datatypes import MSSQLType
from ibis.backends.base.sqlglot.rewrites import (
rewrite_first_to_first_value,
Expand Down Expand Up @@ -373,7 +380,7 @@ def visit_Mean(self, op, *, arg, where):
@visit_node.register(ops.Not)
def visit_Not(self, op, *, arg):
if isinstance(arg, sge.Boolean):
return sge.FALSE if arg == sge.TRUE else sge.TRUE
return FALSE if arg == TRUE else TRUE
return self.if_(arg, 1, 0).eq(0)

@visit_node.register(ops.HashBytes)
Expand Down

0 comments on commit 7e0b735

Please sign in to comment.