summaryrefslogtreecommitdiffstats
path: root/tests/test_executor.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-20 09:37:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-20 09:37:57 +0000
commit5c70c63284a8ff61607db1a51ac2829b74f71c1c (patch)
tree10a81ffbd8da8cae58e292848cbdd0550d08721d /tests/test_executor.py
parentAdding upstream version 21.1.1. (diff)
downloadsqlglot-5c70c63284a8ff61607db1a51ac2829b74f71c1c.tar.xz
sqlglot-5c70c63284a8ff61607db1a51ac2829b74f71c1c.zip
Adding upstream version 21.1.2.upstream/21.1.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_executor.py')
-rw-r--r--tests/test_executor.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_executor.py b/tests/test_executor.py
index 35935b9..9a2b46b 100644
--- a/tests/test_executor.py
+++ b/tests/test_executor.py
@@ -8,7 +8,7 @@ import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
-from sqlglot import exp, parse_one
+from sqlglot import exp, parse_one, transpile
from sqlglot.errors import ExecuteError
from sqlglot.executor import execute
from sqlglot.executor.python import Python
@@ -50,7 +50,7 @@ class TestExecutor(unittest.TestCase):
def cached_execute(self, sql):
if sql not in self.cache:
- self.cache[sql] = self.conn.execute(sql).fetchdf()
+ self.cache[sql] = self.conn.execute(transpile(sql, write="duckdb")[0]).fetchdf()
return self.cache[sql]
def rename_anonymous(self, source, target):
@@ -66,10 +66,10 @@ class TestExecutor(unittest.TestCase):
self.assertEqual(generate(parse_one("x is null")), "scope[None][x] is None")
def test_optimized_tpch(self):
- for i, (sql, optimized) in enumerate(self.sqls[:20], start=1):
+ for i, (sql, optimized) in enumerate(self.sqls, start=1):
with self.subTest(f"{i}, {sql}"):
a = self.cached_execute(sql)
- b = self.conn.execute(optimized).fetchdf()
+ b = self.conn.execute(transpile(optimized, write="duckdb")[0]).fetchdf()
self.rename_anonymous(b, a)
assert_frame_equal(a, b)