summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/pool/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-05-22 14:28:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-05-22 15:24:05 -0400
commit656fd0d73a679a2588289e285328af707e9401d1 (patch)
tree16517d5b939986f04ea421ce957aeccdc0e684df /lib/sqlalchemy/pool/base.py
parent0620614f95f62f35396e63c636cae98a0759f3ab (diff)
downloadsqlalchemy-656fd0d73a679a2588289e285328af707e9401d1.tar.gz
deprecate .connection on _ConnectionFairy, _ConnectionRecord
These are replaced by the read-only ManagesConnection.dbapi_connection attribute. For some reason both of these objects had "setter" for .connection as well; there's no use case for that at all so just remove setter logic entirely. Fixes: #6981 Change-Id: I6425de4a017f6370e1a7476cd491cabc55e55e67
Diffstat (limited to 'lib/sqlalchemy/pool/base.py')
-rw-r--r--lib/sqlalchemy/pool/base.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sqlalchemy/pool/base.py b/lib/sqlalchemy/pool/base.py
index 22be96fad..51eb5e9f5 100644
--- a/lib/sqlalchemy/pool/base.py
+++ b/lib/sqlalchemy/pool/base.py
@@ -621,14 +621,14 @@ class _ConnectionRecord(ConnectionPoolEntry):
self.dbapi_connection
)
- @property
+ @util.deprecated_property(
+ "2.0",
+ "The _ConnectionRecord.connection attribute is deprecated; "
+ "please use 'driver_connection'",
+ )
def connection(self) -> Optional[DBAPIConnection]:
return self.dbapi_connection
- @connection.setter
- def connection(self, value: DBAPIConnection) -> None:
- self.dbapi_connection = value
-
_soft_invalidate_time: float = 0
@util.ro_memoized_property
@@ -1156,14 +1156,14 @@ class _ConnectionFairy(PoolProxiedConnection):
return None
return self._connection_record.driver_connection
- @property
+ @util.deprecated_property(
+ "2.0",
+ "The _ConnectionFairy.connection attribute is deprecated; "
+ "please use 'driver_connection'",
+ )
def connection(self) -> DBAPIConnection:
return self.dbapi_connection
- @connection.setter
- def connection(self, value: DBAPIConnection) -> None:
- self.dbapi_connection = value
-
@classmethod
def _checkout(
cls,