From aa026c302c6b188a7e28508f9ecb603809b9e03f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 30 Oct 2021 14:44:55 -0400 Subject: 2.0 removals: LegacyRow, connectionless execution, close_with_result in order to remove LegacyRow / LegacyResult, we have to also lose close_with_result, which connectionless execution relies upon. also includes a new profiles.txt file that's all against py310, as that's what CI is on now. some result counts changed by one function call which was enough to fail the low-count result tests. Replaces Connectable as the common interface between Connection and Engine with EngineEventsTarget. Engine is no longer Connectable. Connection and MockConnection still are. References: #7257 Change-Id: Iad5eba0313836d347e65490349a22b061356896a --- lib/sqlalchemy/sql/base.py | 40 ---------------------------------------- lib/sqlalchemy/sql/compiler.py | 2 ++ lib/sqlalchemy/sql/schema.py | 13 ------------- 3 files changed, 2 insertions(+), 53 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index aba80222a..4bcb655d6 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -937,46 +937,6 @@ class Executable(roles.StatementRole, Generative): """ return self._execution_options - @util.deprecated_20( - ":meth:`.Executable.execute`", - alternative="All statement execution in SQLAlchemy 2.0 is performed " - "by the :meth:`_engine.Connection.execute` method of " - ":class:`_engine.Connection`, " - "or in the ORM by the :meth:`.Session.execute` method of " - ":class:`.Session`.", - ) - def execute(self, *multiparams, **params): - """Compile and execute this :class:`.Executable`.""" - e = self.bind - if e is None: - label = ( - getattr(self, "description", None) or self.__class__.__name__ - ) - msg = ( - "This %s is not directly bound to a Connection or Engine. " - "Use the .execute() method of a Connection or Engine " - "to execute this construct." % label - ) - raise exc.UnboundExecutionError(msg) - return e._execute_clauseelement( - self, multiparams, params, util.immutabledict() - ) - - @util.deprecated_20( - ":meth:`.Executable.scalar`", - alternative="Scalar execution in SQLAlchemy 2.0 is performed " - "by the :meth:`_engine.Connection.scalar` method of " - ":class:`_engine.Connection`, " - "or in the ORM by the :meth:`.Session.scalar` method of " - ":class:`.Session`.", - ) - def scalar(self, *multiparams, **params): - """Compile and execute this :class:`.Executable`, returning the - result's scalar representation. - - """ - return self.execute(*multiparams, **params).scalar() - @property @util.deprecated_20( ":attr:`.Executable.bind`", diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 0cd568fcc..5c3fbb2b1 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -3186,6 +3186,8 @@ class SQLCompiler(Compiled): # passed in. for ORM use this will convert from an ORM-state # SELECT to a regular "Core" SELECT. other composed operations # such as computation of joins will be performed. + kwargs["within_columns_clause"] = False + compile_state = select_stmt._compile_state_factory( select_stmt, self, **kwargs ) diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 166ad98cd..e45e22564 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -2517,19 +2517,6 @@ class DefaultGenerator(Executable, SchemaItem): else: self.column.default = self - @util.deprecated_20( - ":meth:`.DefaultGenerator.execute`", - alternative="All statement execution in SQLAlchemy 2.0 is performed " - "by the :meth:`_engine.Connection.execute` method of " - ":class:`_engine.Connection`, " - "or in the ORM by the :meth:`.Session.execute` method of " - ":class:`.Session`.", - ) - def execute(self, bind=None): - if bind is None: - bind = _bind_or_error(self) - return bind._execute_default(self, (), util.EMPTY_DICT) - def _execute_on_connection( self, connection, multiparams, params, execution_options ): -- cgit v1.2.1