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/mysql/test_compiler.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/dialect/mysql/test_compiler.py') diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py index cca6a27de..80fc65a0b 100644 --- a/test/dialect/mysql/test_compiler.py +++ b/test/dialect/mysql/test_compiler.py @@ -425,12 +425,13 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL): dialect = self.__dialect__ def gen(distinct=None, prefixes=None): - kw = {} - if distinct is not None: - kw["distinct"] = distinct + stmt = select(column("q")) + if distinct: + stmt = stmt.distinct() if prefixes is not None: - kw["prefixes"] = prefixes - return str(select([column("q")], **kw).compile(dialect=dialect)) + stmt = stmt.prefix_with(*prefixes) + + return str(stmt.compile(dialect=dialect)) eq_(gen(None), "SELECT q") eq_(gen(True), "SELECT DISTINCT q") -- cgit v1.2.1