Skip to content

Commit

Permalink
fix(sqlite): don't use the removed sge.NULL literal
Browse files Browse the repository at this point in the history
  • Loading branch information
kszucs committed Feb 2, 2024
1 parent 81c87d7 commit a05ccff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ibis/backends/sqlite/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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 SQLGlotCompiler
from ibis.backends.base.sqlglot.compiler import NULL, SQLGlotCompiler
from ibis.backends.base.sqlglot.datatypes import SQLiteType
from ibis.backends.base.sqlglot.rewrites import (
rewrite_first_to_first_value,
Expand All @@ -37,7 +37,7 @@ class SQLiteCompiler(SQLGlotCompiler):
rewrite_last_to_last_value,
)

NAN = sge.NULL
NAN = NULL
POS_INF = sge.Literal.number("1e999")
NEG_INF = sge.Literal.number("-1e999")

Expand Down Expand Up @@ -187,10 +187,10 @@ def visit_IdenticalTo(self, op, *, left, right):
@visit_node.register(ops.Clip)
def visit_Clip(self, op, *, arg, lower, upper):
if upper is not None:
arg = self.if_(arg.is_(sge.NULL), arg, self.f.min(upper, arg))
arg = self.if_(arg.is_(NULL), arg, self.f.min(upper, arg))

if lower is not None:
arg = self.if_(arg.is_(sge.NULL), arg, self.f.max(lower, arg))
arg = self.if_(arg.is_(NULL), arg, self.f.max(lower, arg))

return arg

Expand Down Expand Up @@ -220,7 +220,7 @@ def visit_ArgMax(self, *args, **kwargs):
return self._visit_arg_reduction("max", *args, **kwargs)

def _visit_arg_reduction(self, func, op, *, arg, key, where):
cond = arg.is_(sg.not_(sge.NULL))
cond = arg.is_(sg.not_(NULL))

if op.where is not None:
cond = sg.and_(cond, where)
Expand Down

0 comments on commit a05ccff

Please sign in to comment.