From 1f003bcb0b74cecbfe24f52402328b76a07c9983 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 5 Apr 2023 13:19:34 +0100 Subject: Get test suite to full pass with SQLAlchemy 2.0 Remaining issues encountered when running with SQLAlchemy 2.0 for real: * Never call str() on a URL and expect it to be meaningful anymore. The password is aggressively obfuscated now (users absolultely wouldn't let us leave it as is) * More utilities and fixtures that were calling begin() within a block that would have already begun * isnot is now called is_not; mocking "isnot" leads into too many weird compat layers * ORM InstrumentedAttribute and internals use __slots__ now, mock seems to not be able to patch methods. Ideally these tests would use a comparator subclass or something * Connection.connection.connection is now called driver_connection, SQLAlchemy keeps the old name available however oslo.db test suite does not appear to tolerate the deprecation warning emitted, so add a compat layer * mapper() is fully removed from 2.0, not sure if there is another not-yet-committed gerrit that removes mapper() [1] https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine.params.pool_pre_ping [2] https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2fe37eaf2295cebd3bb4ee8e5b8c575c [3] https://github.com/sqlalchemy/sqlalchemy/issues/5648 Change-Id: Ifaca67c07f008d8bc0febeecd3e200cc7ee7a4b0 --- releasenotes/notes/sqlalchemy-20-0a193a01c70f805a.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 releasenotes/notes/sqlalchemy-20-0a193a01c70f805a.yaml (limited to 'releasenotes') diff --git a/releasenotes/notes/sqlalchemy-20-0a193a01c70f805a.yaml b/releasenotes/notes/sqlalchemy-20-0a193a01c70f805a.yaml new file mode 100644 index 0000000..b2c8d62 --- /dev/null +++ b/releasenotes/notes/sqlalchemy-20-0a193a01c70f805a.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + oslo.db now supports SQLAlchemy 2.0. + - | + A new ``oslo_db.compat`` module has been added. This provides a number of + shims for handling differences between SQLAlchemy 1.x and 2.x. +upgrade: + - | + The ability to create engine facades that used autocommit, first deprecated + in 12.1.0, has now been removed. This is not supported in SQLAlchemy 2.x. -- cgit v1.2.1