Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 0bd24a3

Browse files
committed
feat: update tests
1 parent 0665452 commit 0bd24a3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_query.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def test_funcs(self):
197197
t = table("a")
198198

199199
q = c.compile(t.order_by(Random()).limit(10))
200-
self.assertEqual(q, "SELECT * FROM a ORDER BY random() LIMIT 10")
200+
self.assertEqual(q, "SELECT * FROM (SELECT * FROM a ORDER BY random()) AS LIMITED_SELECT LIMIT 10")
201201

202202
q = c.compile(t.select(coalesce(this.a, this.b)))
203203
self.assertEqual(q, "SELECT COALESCE(a, b) FROM a")
@@ -215,7 +215,7 @@ def test_select_distinct(self):
215215

216216
# selects stay apart
217217
q = c.compile(t.limit(10).select(this.b, distinct=True))
218-
self.assertEqual(q, "SELECT DISTINCT b FROM (SELECT * FROM a LIMIT 10) tmp1")
218+
self.assertEqual(q, "SELECT DISTINCT b FROM (SELECT * FROM (SELECT * FROM a) AS LIMITED_SELECT LIMIT 10) tmp1")
219219

220220
q = c.compile(t.select(this.b, distinct=True).select(distinct=False))
221221
self.assertEqual(q, "SELECT * FROM (SELECT DISTINCT b FROM a) tmp2")
@@ -231,7 +231,9 @@ def test_select_with_optimizer_hints(self):
231231
self.assertEqual(q, "SELECT /*+ PARALLEL(a 16) */ b FROM a WHERE (b > 10)")
232232

233233
q = c.compile(t.limit(10).select(this.b, optimizer_hints="PARALLEL(a 16)"))
234-
self.assertEqual(q, "SELECT /*+ PARALLEL(a 16) */ b FROM (SELECT * FROM a LIMIT 10) tmp1")
234+
self.assertEqual(
235+
q, "SELECT /*+ PARALLEL(a 16) */ b FROM (SELECT * FROM (SELECT * FROM a) AS LIMITED_SELECT LIMIT 10) tmp1"
236+
)
235237

236238
q = c.compile(t.select(this.a).group_by(this.b).agg(this.c).select(optimizer_hints="PARALLEL(a 16)"))
237239
self.assertEqual(

0 commit comments

Comments
 (0)