diff options
Diffstat (limited to 'tests/test_executor.py')
-rw-r--r-- | tests/test_executor.py | 8 |
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) |