summaryrefslogtreecommitdiffstats
path: root/tests/test_transforms.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-03 06:02:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-03 06:02:50 +0000
commit766db5014d053a8aecf75d550c2a1b59022bcabf (patch)
tree7960e11339be3a1a4892d61f593903fe58fb9d55 /tests/test_transforms.py
parentReleasing debian version 10.5.10-1. (diff)
downloadsqlglot-766db5014d053a8aecf75d550c2a1b59022bcabf.tar.xz
sqlglot-766db5014d053a8aecf75d550c2a1b59022bcabf.zip
Merging upstream version 10.6.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/test_transforms.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_transforms.py b/tests/test_transforms.py
index cc9af7e..76d63b6 100644
--- a/tests/test_transforms.py
+++ b/tests/test_transforms.py
@@ -9,6 +9,8 @@ from sqlglot.transforms import (
class TestTime(unittest.TestCase):
+ maxDiff = None
+
def validate(self, transform, sql, target):
with self.subTest(sql):
self.assertEqual(parse_one(sql).transform(transform).sql(), target)
@@ -17,7 +19,7 @@ class TestTime(unittest.TestCase):
self.validate(
unalias_group,
"SELECT a, b AS b, c AS c, 4 FROM x GROUP BY a, b, x.c, 4",
- "SELECT a, b AS b, c AS c, 4 FROM x GROUP BY a, b, x.c, 4",
+ "SELECT a, b AS b, c AS c, 4 FROM x GROUP BY a, 2, x.c, 4",
)
self.validate(
unalias_group,
@@ -37,7 +39,12 @@ class TestTime(unittest.TestCase):
self.validate(
unalias_group,
"SELECT the_date AS the_date, COUNT(*) AS the_count FROM x GROUP BY the_date",
- "SELECT the_date AS the_date, COUNT(*) AS the_count FROM x GROUP BY the_date",
+ "SELECT the_date AS the_date, COUNT(*) AS the_count FROM x GROUP BY 1",
+ )
+ self.validate(
+ unalias_group,
+ "SELECT a AS a FROM x GROUP BY DATE(a)",
+ "SELECT a AS a FROM x GROUP BY DATE(a)",
)
def test_eliminate_distinct_on(self):