From a05ccff8aa4bb32e9ec7f6f6c2e610b96c99cb4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20Sz=C5=B1cs?= Date: Fri, 2 Feb 2024 11:06:22 +0100 Subject: [PATCH] fix(sqlite): don't use the removed `sge.NULL` literal --- ibis/backends/sqlite/compiler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ibis/backends/sqlite/compiler.py b/ibis/backends/sqlite/compiler.py index efc31ed689068..5e1b5f91abfcb 100644 --- a/ibis/backends/sqlite/compiler.py +++ b/ibis/backends/sqlite/compiler.py @@ -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, @@ -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") @@ -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 @@ -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)