summaryrefslogtreecommitdiffstats
path: root/sqlglot/executor/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/executor/python.py')
-rw-r--r--sqlglot/executor/python.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sqlglot/executor/python.py b/sqlglot/executor/python.py
index 34a380e..d2ae79d 100644
--- a/sqlglot/executor/python.py
+++ b/sqlglot/executor/python.py
@@ -417,7 +417,9 @@ class Python(Dialect):
exp.Extract: lambda self, e: f"EXTRACT('{e.name.lower()}', {self.sql(e, 'expression')})",
exp.In: lambda self, e: f"{self.sql(e, 'this')} in {{{self.expressions(e, flat=True)}}}",
exp.Interval: lambda self, e: f"INTERVAL({self.sql(e.this)}, '{self.sql(e.unit)}')",
- exp.Is: lambda self, e: self.binary(e, "is"),
+ exp.Is: lambda self, e: self.binary(e, "==")
+ if isinstance(e.this, exp.Literal)
+ else self.binary(e, "is"),
exp.Lambda: _lambda_sql,
exp.Not: lambda self, e: f"not {self.sql(e.this)}",
exp.Null: lambda *_: "None",