From a1fb461e0591b79975d087022749eced88b630f8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 5 Aug 2024 15:08:57 -0400 Subject: [PATCH] cherry-pick changelog from 2.0.32 --- doc/build/changelog/changelog_20.rst | 187 +++++++++++++++++- doc/build/changelog/unreleased_20/10267.rst | 13 -- doc/build/changelog/unreleased_20/10820.rst | 7 - doc/build/changelog/unreleased_20/10834.rst | 8 - doc/build/changelog/unreleased_20/11163.rst | 11 -- doc/build/changelog/unreleased_20/11435.rst | 10 - doc/build/changelog/unreleased_20/11471.rst | 9 - doc/build/changelog/unreleased_20/11479.rst | 7 - doc/build/changelog/unreleased_20/11480.rst | 9 - doc/build/changelog/unreleased_20/11522.rst | 7 - doc/build/changelog/unreleased_20/11530.rst | 8 - doc/build/changelog/unreleased_20/11532.rst | 8 - doc/build/changelog/unreleased_20/11575.rst | 8 - doc/build/changelog/unreleased_20/11576.rst | 11 -- doc/build/changelog/unreleased_20/11592.rst | 9 - doc/build/changelog/unreleased_20/11625.rst | 9 - doc/build/changelog/unreleased_20/11661.rst | 10 - doc/build/changelog/unreleased_20/11663.rst | 16 -- .../changelog/unreleased_20/mypy1110.rst | 7 - 19 files changed, 186 insertions(+), 168 deletions(-) delete mode 100644 doc/build/changelog/unreleased_20/10267.rst delete mode 100644 doc/build/changelog/unreleased_20/10820.rst delete mode 100644 doc/build/changelog/unreleased_20/10834.rst delete mode 100644 doc/build/changelog/unreleased_20/11163.rst delete mode 100644 doc/build/changelog/unreleased_20/11435.rst delete mode 100644 doc/build/changelog/unreleased_20/11471.rst delete mode 100644 doc/build/changelog/unreleased_20/11479.rst delete mode 100644 doc/build/changelog/unreleased_20/11480.rst delete mode 100644 doc/build/changelog/unreleased_20/11522.rst delete mode 100644 doc/build/changelog/unreleased_20/11530.rst delete mode 100644 doc/build/changelog/unreleased_20/11532.rst delete mode 100644 doc/build/changelog/unreleased_20/11575.rst delete mode 100644 doc/build/changelog/unreleased_20/11576.rst delete mode 100644 doc/build/changelog/unreleased_20/11592.rst delete mode 100644 doc/build/changelog/unreleased_20/11625.rst delete mode 100644 doc/build/changelog/unreleased_20/11661.rst delete mode 100644 doc/build/changelog/unreleased_20/11663.rst delete mode 100644 doc/build/changelog/unreleased_20/mypy1110.rst diff --git a/doc/build/changelog/changelog_20.rst b/doc/build/changelog/changelog_20.rst index ec885b1a48..f6f324bd62 100644 --- a/doc/build/changelog/changelog_20.rst +++ b/doc/build/changelog/changelog_20.rst @@ -10,7 +10,192 @@ .. changelog:: :version: 2.0.32 - :include_notes_from: unreleased_20 + :released: August 5, 2024 + + .. change:: + :tags: bug, examples + :tickets: 10267 + + Fixed issue in history_meta example where the "version" column in the + versioned table needs to default to the most recent version number in the + history table on INSERT, to suit the use case of a table where rows are + deleted, and can then be replaced by new rows that re-use the same primary + key identity. This fix adds an additonal SELECT query per INSERT in the + main table, which may be inefficient; for cases where primary keys are not + re-used, the default function may be omitted. Patch courtesy Philipp H. + v. Loewenfeld. + + + .. change:: + :tags: oracle, usecase + :tickets: 10820 + + Added API support for server-side cursors for the oracledb async dialect, + allowing use of the :meth:`_asyncio.AsyncConnection.stream` and similar + stream methods. + + .. change:: + :tags: bug, orm + :tickets: 10834 + + Fixed issue where using the :meth:`_orm.Query.enable_eagerloads` and + :meth:`_orm.Query.yield_per` methods at the same time, in order to disable + eager loading that's configured on the mapper directly, would be silently + ignored, leading to errors or unexpected eager population of attributes. + + .. change:: + :tags: orm + :tickets: 11163 + + Added a warning noting when an + :meth:`_engine.ConnectionEvents.engine_connect` event may be leaving + a transaction open, which can alter the behavior of a + :class:`_orm.Session` using such an engine as bind. + On SQLAlchemy 2.1 :paramref:`_orm.Session.join_transaction_mode` will + instead be ignored in all cases when the session bind is + an :class:`_engine.Engine`. + + .. change:: + :tags: bug, general, regression + :tickets: 11435 + + Restored legacy class names removed from + ``sqlalalchemy.orm.collections.*``, including + :class:`_orm.MappedCollection`, :func:`_orm.mapped_collection`, + :func:`_orm.column_mapped_collection`, + :func:`_orm.attribute_mapped_collection`. Pull request courtesy Takashi + Kajinami. + + .. change:: + :tags: bug, sql + :tickets: 11471 + + Follow up of :ticket:`11471` to fix caching issue where using the + :meth:`.CompoundSelectState.add_cte` method of the + :class:`.CompoundSelectState` construct would not set a correct cache key + which distinguished between different CTE expressions. Also added tests + that would detect issues similar to the one fixed in :ticket:`11544`. + + .. change:: + :tags: bug, mysql + :tickets: 11479 + + Fixed issue in MySQL dialect where ENUM values that contained percent signs + were not properly escaped for the driver. + + + .. change:: + :tags: usecase, oracle + :tickets: 11480 + + Implemented two-phase transactions for the oracledb dialect. Historically, + this feature never worked with the cx_Oracle dialect, however recent + improvements to the oracledb successor now allow this to be possible. The + two phase transaction API is available at the Core level via the + :meth:`_engine.Connection.begin_twophase` method. + + .. change:: + :tags: bug, postgresql + :tickets: 11522 + + It is now considered a pool-invalidating disconnect event when psycopg2 + throws an "SSL SYSCALL error: Success" error message, which can occur when + the SSL connection to Postgres is terminated abnormally. + + .. change:: + :tags: bug, schema + :tickets: 11530 + + Fixed additional issues in the event system triggered by unpickling of a + :class:`.Enum` datatype, continuing from :ticket:`11365` and + :ticket:`11360`, where dynamically generated elements of the event + structure would not be present when unpickling in a new process. + + .. change:: + :tags: bug, engine + :tickets: 11532 + + Fixed issue in "insertmanyvalues" feature where a particular call to + ``cursor.fetchall()`` were not wrapped in SQLAlchemy's exception wrapper, + which apparently can raise a database exception during fetch when using + pyodbc. + + .. change:: + :tags: usecase, orm + :tickets: 11575 + + The :paramref:`_orm.aliased.name` parameter to :func:`_orm.aliased` may now + be combined with the :paramref:`_orm.aliased.flat` parameter, producing + per-table names based on a name-prefixed naming convention. Pull request + courtesy Eric Atkin. + + .. change:: + :tags: bug, postgresql + :tickets: 11576 + + Fixed issue where the :func:`_sql.collate` construct, which explicitly sets + a collation for a given expression, would maintain collation settings for + the underlying type object from the expression, causing SQL expressions to + have both collations stated at once when used in further expressions for + specific dialects that render explicit type casts, such as that of asyncpg. + The :func:`_sql.collate` construct now assigns its own type to explicitly + include the new collation, assuming it's a string type. + + .. change:: + :tags: bug, sql + :tickets: 11592 + + Fixed bug where the :meth:`.Operators.nulls_first()` and + :meth:`.Operators.nulls_last()` modifiers would not be treated the same way + as :meth:`.Operators.desc()` and :meth:`.Operators.asc()` when determining + if an ORDER BY should be against a label name already in the statement. All + four modifiers are now treated the same within ORDER BY. + + .. change:: + :tags: bug, orm, regression + :tickets: 11625 + + Fixed regression appearing in 2.0.21 caused by :ticket:`10279` where using + a :func:`_sql.delete` or :func:`_sql.update` against an ORM class that is + the base of an inheritance hierarchy, while also specifying that subclasses + should be loaded polymorphically, would leak the polymorphic joins into the + UPDATE or DELETE statement as well creating incorrect SQL. + + .. change:: + :tags: bug, orm, regression + :tickets: 11661 + + Fixed regression from version 1.4 in + :meth:`_orm.Session.bulk_insert_mappings` where using the + :paramref:`_orm.Session.bulk_insert_mappings.return_defaults` parameter + would not populate the passed in dictionaries with newly generated primary + key values. + + + .. change:: + :tags: bug, oracle, sqlite + :tickets: 11663 + + Implemented bitwise operators for Oracle which was previously + non-functional due to a non-standard syntax used by this database. + Oracle's support for bitwise "or" and "xor" starts with server version 21. + Additionally repaired the implementation of "xor" for SQLite. + + As part of this change, the dialect compliance test suite has been enhanced + to include support for server-side bitwise tests; third party dialect + authors should refer to new "supports_bitwise" methods in the + requirements.py file to enable these tests. + + + + + .. change:: + :tags: bug, typing + + Fixed internal typing issues to establish compatibility with mypy 1.11.0. + Note that this does not include issues which have arisen with the + deprecated mypy plugin used by SQLAlchemy 1.4-style code; see the addiional + change note for this plugin indicating revised compatibility. .. changelog:: :version: 2.0.31 diff --git a/doc/build/changelog/unreleased_20/10267.rst b/doc/build/changelog/unreleased_20/10267.rst deleted file mode 100644 index cfbf04f6db..0000000000 --- a/doc/build/changelog/unreleased_20/10267.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. change:: - :tags: bug, examples - :tickets: 10267 - - Fixed issue in history_meta example where the "version" column in the - versioned table needs to default to the most recent version number in the - history table on INSERT, to suit the use case of a table where rows are - deleted, and can then be replaced by new rows that re-use the same primary - key identity. This fix adds an additonal SELECT query per INSERT in the - main table, which may be inefficient; for cases where primary keys are not - re-used, the default function may be omitted. Patch courtesy Philipp H. - v. Loewenfeld. - diff --git a/doc/build/changelog/unreleased_20/10820.rst b/doc/build/changelog/unreleased_20/10820.rst deleted file mode 100644 index e2cc717e2e..0000000000 --- a/doc/build/changelog/unreleased_20/10820.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: oracle, usecase - :tickets: 10820 - - Added API support for server-side cursors for the oracledb async dialect, - allowing use of the :meth:`_asyncio.AsyncConnection.stream` and similar - stream methods. diff --git a/doc/build/changelog/unreleased_20/10834.rst b/doc/build/changelog/unreleased_20/10834.rst deleted file mode 100644 index 7670f57ad1..0000000000 --- a/doc/build/changelog/unreleased_20/10834.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 10834 - - Fixed issue where using the :meth:`_orm.Query.enable_eagerloads` and - :meth:`_orm.Query.yield_per` methods at the same time, in order to disable - eager loading that's configured on the mapper directly, would be silently - ignored, leading to errors or unexpected eager population of attributes. diff --git a/doc/build/changelog/unreleased_20/11163.rst b/doc/build/changelog/unreleased_20/11163.rst deleted file mode 100644 index da21b45378..0000000000 --- a/doc/build/changelog/unreleased_20/11163.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: orm - :tickets: 11163 - - Added a warning noting when an - :meth:`_engine.ConnectionEvents.engine_connect` event may be leaving - a transaction open, which can alter the behavior of a - :class:`_orm.Session` using such an engine as bind. - On SQLAlchemy 2.1 :paramref:`_orm.Session.join_transaction_mode` will - instead be ignored in all cases when the session bind is - an :class:`_engine.Engine`. diff --git a/doc/build/changelog/unreleased_20/11435.rst b/doc/build/changelog/unreleased_20/11435.rst deleted file mode 100644 index a3f96de18c..0000000000 --- a/doc/build/changelog/unreleased_20/11435.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: bug, general, regression - :tickets: 11435 - - Restored legacy class names removed from - ``sqlalalchemy.orm.collections.*``, including - :class:`_orm.MappedCollection`, :func:`_orm.mapped_collection`, - :func:`_orm.column_mapped_collection`, - :func:`_orm.attribute_mapped_collection`. Pull request courtesy Takashi - Kajinami. diff --git a/doc/build/changelog/unreleased_20/11471.rst b/doc/build/changelog/unreleased_20/11471.rst deleted file mode 100644 index 4170de0298..0000000000 --- a/doc/build/changelog/unreleased_20/11471.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 11471 - - Follow up of :ticket:`11471` to fix caching issue where using the - :meth:`.CompoundSelectState.add_cte` method of the - :class:`.CompoundSelectState` construct would not set a correct cache key - which distinguished between different CTE expressions. Also added tests - that would detect issues similar to the one fixed in :ticket:`11544`. diff --git a/doc/build/changelog/unreleased_20/11479.rst b/doc/build/changelog/unreleased_20/11479.rst deleted file mode 100644 index fccaaf8026..0000000000 --- a/doc/build/changelog/unreleased_20/11479.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: bug, mysql - :tickets: 11479 - - Fixed issue in MySQL dialect where ENUM values that contained percent signs - were not properly escaped for the driver. - diff --git a/doc/build/changelog/unreleased_20/11480.rst b/doc/build/changelog/unreleased_20/11480.rst deleted file mode 100644 index 7a653a6b69..0000000000 --- a/doc/build/changelog/unreleased_20/11480.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: usecase, oracle - :tickets: 11480 - - Implemented two-phase transactions for the oracledb dialect. Historically, - this feature never worked with the cx_Oracle dialect, however recent - improvements to the oracledb successor now allow this to be possible. The - two phase transaction API is available at the Core level via the - :meth:`_engine.Connection.begin_twophase` method. diff --git a/doc/build/changelog/unreleased_20/11522.rst b/doc/build/changelog/unreleased_20/11522.rst deleted file mode 100644 index 279197a779..0000000000 --- a/doc/build/changelog/unreleased_20/11522.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 11522 - - It is now considered a pool-invalidating disconnect event when psycopg2 - throws an "SSL SYSCALL error: Success" error message, which can occur when - the SSL connection to Postgres is terminated abnormally. \ No newline at end of file diff --git a/doc/build/changelog/unreleased_20/11530.rst b/doc/build/changelog/unreleased_20/11530.rst deleted file mode 100644 index 1ffa7c5d26..0000000000 --- a/doc/build/changelog/unreleased_20/11530.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, schema - :tickets: 11530 - - Fixed additional issues in the event system triggered by unpickling of a - :class:`.Enum` datatype, continuing from :ticket:`11365` and - :ticket:`11360`, where dynamically generated elements of the event - structure would not be present when unpickling in a new process. diff --git a/doc/build/changelog/unreleased_20/11532.rst b/doc/build/changelog/unreleased_20/11532.rst deleted file mode 100644 index 141463d583..0000000000 --- a/doc/build/changelog/unreleased_20/11532.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, engine - :tickets: 11532 - - Fixed issue in "insertmanyvalues" feature where a particular call to - ``cursor.fetchall()`` were not wrapped in SQLAlchemy's exception wrapper, - which apparently can raise a database exception during fetch when using - pyodbc. diff --git a/doc/build/changelog/unreleased_20/11575.rst b/doc/build/changelog/unreleased_20/11575.rst deleted file mode 100644 index 4eb56655fa..0000000000 --- a/doc/build/changelog/unreleased_20/11575.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: usecase, orm - :tickets: 11575 - - The :paramref:`_orm.aliased.name` parameter to :func:`_orm.aliased` may now - be combined with the :paramref:`_orm.aliased.flat` parameter, producing - per-table names based on a name-prefixed naming convention. Pull request - courtesy Eric Atkin. diff --git a/doc/build/changelog/unreleased_20/11576.rst b/doc/build/changelog/unreleased_20/11576.rst deleted file mode 100644 index 93cfe3bf03..0000000000 --- a/doc/build/changelog/unreleased_20/11576.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 11576 - - Fixed issue where the :func:`_sql.collate` construct, which explicitly sets - a collation for a given expression, would maintain collation settings for - the underlying type object from the expression, causing SQL expressions to - have both collations stated at once when used in further expressions for - specific dialects that render explicit type casts, such as that of asyncpg. - The :func:`_sql.collate` construct now assigns its own type to explicitly - include the new collation, assuming it's a string type. diff --git a/doc/build/changelog/unreleased_20/11592.rst b/doc/build/changelog/unreleased_20/11592.rst deleted file mode 100644 index 616eb1e286..0000000000 --- a/doc/build/changelog/unreleased_20/11592.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 11592 - - Fixed bug where the :meth:`.Operators.nulls_first()` and - :meth:`.Operators.nulls_last()` modifiers would not be treated the same way - as :meth:`.Operators.desc()` and :meth:`.Operators.asc()` when determining - if an ORDER BY should be against a label name already in the statement. All - four modifiers are now treated the same within ORDER BY. diff --git a/doc/build/changelog/unreleased_20/11625.rst b/doc/build/changelog/unreleased_20/11625.rst deleted file mode 100644 index c32a90ad82..0000000000 --- a/doc/build/changelog/unreleased_20/11625.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, orm, regression - :tickets: 11625 - - Fixed regression appearing in 2.0.21 caused by :ticket:`10279` where using - a :func:`_sql.delete` or :func:`_sql.update` against an ORM class that is - the base of an inheritance hierarchy, while also specifying that subclasses - should be loaded polymorphically, would leak the polymorphic joins into the - UPDATE or DELETE statement as well creating incorrect SQL. diff --git a/doc/build/changelog/unreleased_20/11661.rst b/doc/build/changelog/unreleased_20/11661.rst deleted file mode 100644 index 35985d8bba..0000000000 --- a/doc/build/changelog/unreleased_20/11661.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: bug, orm, regression - :tickets: 11661 - - Fixed regression from version 1.4 in - :meth:`_orm.Session.bulk_insert_mappings` where using the - :paramref:`_orm.Session.bulk_insert_mappings.return_defaults` parameter - would not populate the passed in dictionaries with newly generated primary - key values. - diff --git a/doc/build/changelog/unreleased_20/11663.rst b/doc/build/changelog/unreleased_20/11663.rst deleted file mode 100644 index 599cd744bf..0000000000 --- a/doc/build/changelog/unreleased_20/11663.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. change:: - :tags: bug, oracle, sqlite - :tickets: 11663 - - Implemented bitwise operators for Oracle which was previously - non-functional due to a non-standard syntax used by this database. - Oracle's support for bitwise "or" and "xor" starts with server version 21. - Additionally repaired the implementation of "xor" for SQLite. - - As part of this change, the dialect compliance test suite has been enhanced - to include support for server-side bitwise tests; third party dialect - authors should refer to new "supports_bitwise" methods in the - requirements.py file to enable these tests. - - - diff --git a/doc/build/changelog/unreleased_20/mypy1110.rst b/doc/build/changelog/unreleased_20/mypy1110.rst deleted file mode 100644 index 7804da4c03..0000000000 --- a/doc/build/changelog/unreleased_20/mypy1110.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: bug, typing - - Fixed internal typing issues to establish compatibility with mypy 1.11.0. - Note that this does not include issues which have arisen with the - deprecated mypy plugin used by SQLAlchemy 1.4-style code; see the addiional - change note for this plugin indicating revised compatibility. -- 2.47.2