diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-06 07:28:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-06 07:28:09 +0000 |
commit | 52f4a5e2260f3e5b919b4e270339afd670bf0b8a (patch) | |
tree | 5ca419af0e2e409018492b82f5b9847f0112b5fb /sqlglot/executor/python.py | |
parent | Adding upstream version 16.7.7. (diff) | |
download | sqlglot-upstream/17.2.0.tar.xz sqlglot-upstream/17.2.0.zip |
Adding upstream version 17.2.0.upstream/17.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/executor/python.py')
-rw-r--r-- | sqlglot/executor/python.py | 4 |
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", |