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 --- lib/sqlalchemy/engine/default.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/engine') diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 0bd4cd14c..198ec4159 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -603,7 +603,7 @@ class DefaultDialect(interfaces.Dialect): @util.memoized_property def _dialect_specific_select_one(self): - return str(expression.select([1]).compile(dialect=self)) + return str(expression.select(1).compile(dialect=self)) def do_ping(self, dbapi_connection): cursor = None @@ -1586,9 +1586,7 @@ class DefaultExecutionContext(interfaces.ExecutionContext): default_arg = expression.type_coerce(default.arg, type_) else: default_arg = default.arg - compiled = expression.select([default_arg]).compile( - dialect=self.dialect - ) + compiled = expression.select(default_arg).compile(dialect=self.dialect) compiled_params = compiled.construct_params() processors = compiled._bind_processors if compiled.positional: -- cgit v1.2.1