From e8600608669d90c4a6385b312d271aed63eb5854 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Wed, 2 Sep 2020 23:46:06 +0200 Subject: Update select usage to use the new 1.4 format This change includes mainly that the bracketed use within select() is moved to positional, and keyword arguments are removed from calls to the select() function. it does not yet fully address other issues such as keyword arguments passed to the table.select(). Additionally, allows False / None to both be considered as "disable" for all of select.correlate(), select.correlate_except(), query.correlate(), which establishes consistency with passing of ``False`` for the legact select(correlate=False) argument. Change-Id: Ie6c6e6abfbd3d75d4c8de504c0cf0159e6999108 --- test/dialect/postgresql/test_compiler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/dialect/postgresql/test_compiler.py') diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 556601fc6..ddf03daf1 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -1646,7 +1646,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): series = func.generate_series(1, 100).alias("series") series_col = column("series") query = select( - [func.array_agg(series_col).filter(series_col % 2 == 0)[3]] + func.array_agg(series_col).filter(series_col % 2 == 0)[3] ).select_from(series) self.assert_compile( query, @@ -2143,22 +2143,22 @@ class DistinctOnTest(fixtures.TestBase, AssertsCompiledSQL): def test_plain_inline(self): self.assert_compile( - select([self.table], distinct=True), + select(self.table).distinct(), "SELECT DISTINCT t.id, t.a, t.b FROM t", ) def test_on_columns_inline_list(self): self.assert_compile( - select( - [self.table], distinct=[self.table.c.a, self.table.c.b] - ).order_by(self.table.c.a, self.table.c.b), + select(self.table) + .distinct(self.table.c.a, self.table.c.b) + .order_by(self.table.c.a, self.table.c.b), "SELECT DISTINCT ON (t.a, t.b) t.id, " "t.a, t.b FROM t ORDER BY t.a, t.b", ) def test_on_columns_inline_scalar(self): self.assert_compile( - select([self.table], distinct=self.table.c.a), + select(self.table).distinct(self.table.c.a), "SELECT DISTINCT ON (t.a) t.id, t.a, t.b FROM t", ) -- cgit v1.2.1