From: Mike Bayer Date: Sun, 11 Feb 2024 15:15:17 +0000 (-0500) Subject: cherry-pick changelog from 2.0.26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0029e7c99111d618c86eec119fe739d07f36325;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git cherry-pick changelog from 2.0.26 --- diff --git a/doc/build/changelog/changelog_20.rst b/doc/build/changelog/changelog_20.rst index 5bd0385fc5..79631ed762 100644 --- a/doc/build/changelog/changelog_20.rst +++ b/doc/build/changelog/changelog_20.rst @@ -10,7 +10,187 @@ .. changelog:: :version: 2.0.26 - :include_notes_from: unreleased_20 + :released: February 11, 2024 + + .. change:: + :tags: usecase, postgresql, reflection + :tickets: 10777 + + Added support for reflection of PostgreSQL CHECK constraints marked with + "NO INHERIT", setting the key ``no_inherit=True`` in the reflected data. + Pull request courtesy Ellis Valentiner. + + .. change:: + :tags: bug, sql + :tickets: 10843 + + Fixed issues in :func:`_sql.case` where the logic for determining the + type of the expression could result in :class:`.NullType` if the last + element in the "whens" had no type, or in other cases where the type + could resolve to ``None``. The logic has been updated to scan all + given expressions so that the first non-null type is used, as well as + to always ensure a type is present. Pull request courtesy David Evans. + + .. change:: + :tags: bug, mysql + :tickets: 10850 + + Fixed issue where NULL/NOT NULL would not be properly reflected from a + MySQL column that also specified the VIRTUAL or STORED directives. Pull + request courtesy Georg Wicke-Arndt. + + .. change:: + :tags: bug, regression, postgresql + :tickets: 10863 + + Fixed regression in the asyncpg dialect caused by :ticket:`10717` in + release 2.0.24 where the change that now attempts to gracefully close the + asyncpg connection before terminating would not fall back to + ``terminate()`` for other potential connection-related exceptions other + than a timeout error, not taking into account cases where the graceful + ``.close()`` attempt fails for other reasons such as connection errors. + + + .. change:: + :tags: oracle, bug, performance + :tickets: 10877 + + Changed the default arraysize of the Oracle dialects so that the value set + by the driver is used, that is 100 at the time of writing for both + cx_oracle and oracledb. Previously the value was set to 50 by default. The + setting of 50 could cause significant performance regressions compared to + when using cx_oracle/oracledb alone to fetch many hundreds of rows over + slower networks. + + .. change:: + :tags: bug, mysql + :tickets: 10893 + + Fixed issue in asyncio dialects asyncmy and aiomysql, where their + ``.close()`` method is apparently not a graceful close. replace with + non-standard ``.ensure_closed()`` method that's awaitable and move + ``.close()`` to the so-called "terminate" case. + + .. change:: + :tags: bug, orm + :tickets: 10896 + + Replaced the "loader depth is excessively deep" warning with a shorter + message added to the caching badge within SQL logging, for those statements + where the ORM disabled the cache due to a too-deep chain of loader options. + The condition which this warning highlights is difficult to resolve and is + generally just a limitation in the ORM's application of SQL caching. A + future feature may include the ability to tune the threshold where caching + is disabled, but for now the warning will no longer be a nuisance. + + .. change:: + :tags: bug, orm + :tickets: 10899 + + Fixed issue where it was not possible to use a type (such as an enum) + within a :class:`_orm.Mapped` container type if that type were declared + locally within the class body. The scope of locals used for the eval now + includes that of the class body itself. In addition, the expression within + :class:`_orm.Mapped` may also refer to the class name itself, if used as a + string or with future annotations mode. + + .. change:: + :tags: usecase, postgresql + :tickets: 10904 + + Support the ``USING `` option for PostgreSQL ``CREATE TABLE`` to + specify the access method to use to store the contents for the new table. + Pull request courtesy Edgar Ramírez-Mondragón. + + .. seealso:: + + :ref:`postgresql_table_options` + + .. change:: + :tags: bug, examples + :tickets: 10920 + + Fixed regression in history_meta example where the use of + :meth:`_schema.MetaData.to_metadata` to make a copy of the history table + would also copy indexes (which is a good thing), but causing naming + conflicts indexes regardless of naming scheme used for those indexes. A + "_history" suffix is now added to these indexes in the same way as is + achieved for the table name. + + + .. change:: + :tags: bug, orm + :tickets: 10967 + + Fixed issue where using :meth:`_orm.Session.delete` along with the + :paramref:`_orm.Mapper.version_id_col` feature would fail to use the + correct version identifier in the case that an additional UPDATE were + emitted against the target object as a result of the use of + :paramref:`_orm.relationship.post_update` on the object. The issue is + similar to :ticket:`10800` just fixed in version 2.0.25 for the case of + updates alone. + + .. change:: + :tags: bug, orm + :tickets: 10990 + + Fixed issue where an assertion within the implementation for + :func:`_orm.with_expression` would raise if a SQL expression that was not + cacheable were used; this was a 2.0 regression since 1.4. + + .. change:: + :tags: postgresql, usecase + :tickets: 9736 + + Correctly type PostgreSQL RANGE and MULTIRANGE types as ``Range[T]`` + and ``Sequence[Range[T]]``. + Introduced utility sequence :class:`_postgresql.MultiRange` to allow better + interoperability of MULTIRANGE types. + + .. change:: + :tags: postgresql, usecase + + Differentiate between INT4 and INT8 ranges and multi-ranges types when + inferring the database type from a :class:`_postgresql.Range` or + :class:`_postgresql.MultiRange` instance, preferring INT4 if the values + fit into it. + + .. change:: + :tags: bug, typing + + Fixed the type signature for the :meth:`.PoolEvents.checkin` event to + indicate that the given :class:`.DBAPIConnection` argument may be ``None`` + in the case where the connection has been invalidated. + + .. change:: + :tags: bug, examples + + Fixed the performance example scripts in examples/performance to mostly + work with the Oracle database, by adding the :class:`.Identity` construct + to all the tables and allowing primary generation to occur on this backend. + A few of the "raw DBAPI" cases still are not compatible with Oracle. + + + .. change:: + :tags: bug, mssql + + Fixed an issue regarding the use of the :class:`.Uuid` datatype with the + :paramref:`.Uuid.as_uuid` parameter set to False, when using the pymssql + dialect. ORM-optimized INSERT statements (e.g. the "insertmanyvalues" + feature) would not correctly align primary key UUID values for bulk INSERT + statements, resulting in errors. Similar issues were fixed for the + PostgreSQL drivers as well. + + + .. change:: + :tags: bug, postgresql + + Fixed an issue regarding the use of the :class:`.Uuid` datatype with the + :paramref:`.Uuid.as_uuid` parameter set to False, when using PostgreSQL + dialects. ORM-optimized INSERT statements (e.g. the "insertmanyvalues" + feature) would not correctly align primary key UUID values for bulk INSERT + statements, resulting in errors. Similar issues were fixed for the + pymssql driver as well. .. changelog:: :version: 2.0.25 diff --git a/doc/build/changelog/unreleased_20/10777.rst b/doc/build/changelog/unreleased_20/10777.rst deleted file mode 100644 index cee5092e8d..0000000000 --- a/doc/build/changelog/unreleased_20/10777.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: usecase, postgresql, reflection - :tickets: 10777 - - Added support for reflection of PostgreSQL CHECK constraints marked with - "NO INHERIT", setting the key ``no_inherit=True`` in the reflected data. - Pull request courtesy Ellis Valentiner. diff --git a/doc/build/changelog/unreleased_20/10843.rst b/doc/build/changelog/unreleased_20/10843.rst deleted file mode 100644 index 838f6a8beb..0000000000 --- a/doc/build/changelog/unreleased_20/10843.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 10843 - - Fixed issues in :func:`_sql.case` where the logic for determining the - type of the expression could result in :class:`.NullType` if the last - element in the "whens" had no type, or in other cases where the type - could resolve to ``None``. The logic has been updated to scan all - given expressions so that the first non-null type is used, as well as - to always ensure a type is present. Pull request courtesy David Evans. diff --git a/doc/build/changelog/unreleased_20/10850.rst b/doc/build/changelog/unreleased_20/10850.rst deleted file mode 100644 index 6b6b323ce8..0000000000 --- a/doc/build/changelog/unreleased_20/10850.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: bug, mysql - :tickets: 10850 - - Fixed issue where NULL/NOT NULL would not be properly reflected from a - MySQL column that also specified the VIRTUAL or STORED directives. Pull - request courtesy Georg Wicke-Arndt. diff --git a/doc/build/changelog/unreleased_20/10863.rst b/doc/build/changelog/unreleased_20/10863.rst deleted file mode 100644 index df722f8fe4..0000000000 --- a/doc/build/changelog/unreleased_20/10863.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, regression, postgresql - :tickets: 10863 - - Fixed regression in the asyncpg dialect caused by :ticket:`10717` in - release 2.0.24 where the change that now attempts to gracefully close the - asyncpg connection before terminating would not fall back to - ``terminate()`` for other potential connection-related exceptions other - than a timeout error, not taking into account cases where the graceful - ``.close()`` attempt fails for other reasons such as connection errors. - diff --git a/doc/build/changelog/unreleased_20/10877.rst b/doc/build/changelog/unreleased_20/10877.rst deleted file mode 100644 index 90bf75f249..0000000000 --- a/doc/build/changelog/unreleased_20/10877.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: oracle, bug, performance - :tickets: 10877 - - Changed the default arraysize of the Oracle dialects so that the value set - by the driver is used, that is 100 at the time of writing for both - cx_oracle and oracledb. Previously the value was set to 50 by default. The - setting of 50 could cause significant performance regressions compared to - when using cx_oracle/oracledb alone to fetch many hundreds of rows over - slower networks. diff --git a/doc/build/changelog/unreleased_20/10893.rst b/doc/build/changelog/unreleased_20/10893.rst deleted file mode 100644 index 63507f38d5..0000000000 --- a/doc/build/changelog/unreleased_20/10893.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, mysql - :tickets: 10893 - - Fixed issue in asyncio dialects asyncmy and aiomysql, where their - ``.close()`` method is apparently not a graceful close. replace with - non-standard ``.ensure_closed()`` method that's awaitable and move - ``.close()`` to the so-called "terminate" case. diff --git a/doc/build/changelog/unreleased_20/10896.rst b/doc/build/changelog/unreleased_20/10896.rst deleted file mode 100644 index 77224d974c..0000000000 --- a/doc/build/changelog/unreleased_20/10896.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 10896 - - Replaced the "loader depth is excessively deep" warning with a shorter - message added to the caching badge within SQL logging, for those statements - where the ORM disabled the cache due to a too-deep chain of loader options. - The condition which this warning highlights is difficult to resolve and is - generally just a limitation in the ORM's application of SQL caching. A - future feature may include the ability to tune the threshold where caching - is disabled, but for now the warning will no longer be a nuisance. diff --git a/doc/build/changelog/unreleased_20/10899.rst b/doc/build/changelog/unreleased_20/10899.rst deleted file mode 100644 index 692381323e..0000000000 --- a/doc/build/changelog/unreleased_20/10899.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 10899 - - Fixed issue where it was not possible to use a type (such as an enum) - within a :class:`_orm.Mapped` container type if that type were declared - locally within the class body. The scope of locals used for the eval now - includes that of the class body itself. In addition, the expression within - :class:`_orm.Mapped` may also refer to the class name itself, if used as a - string or with future annotations mode. diff --git a/doc/build/changelog/unreleased_20/10904.rst b/doc/build/changelog/unreleased_20/10904.rst deleted file mode 100644 index 3dc744dc18..0000000000 --- a/doc/build/changelog/unreleased_20/10904.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: usecase, postgresql - :tickets: 10904 - - Support the ``USING `` option for PostgreSQL ``CREATE TABLE`` to - specify the access method to use to store the contents for the new table. - Pull request courtesy Edgar Ramírez-Mondragón. - - .. seealso:: - - :ref:`postgresql_table_options` diff --git a/doc/build/changelog/unreleased_20/10920.rst b/doc/build/changelog/unreleased_20/10920.rst deleted file mode 100644 index e7bc7b8acd..0000000000 --- a/doc/build/changelog/unreleased_20/10920.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, examples - :tickets: 10920 - - Fixed regression in history_meta example where the use of - :meth:`_schema.MetaData.to_metadata` to make a copy of the history table - would also copy indexes (which is a good thing), but causing naming - conflicts indexes regardless of naming scheme used for those indexes. A - "_history" suffix is now added to these indexes in the same way as is - achieved for the table name. - diff --git a/doc/build/changelog/unreleased_20/10967.rst b/doc/build/changelog/unreleased_20/10967.rst deleted file mode 100644 index b0ed4d1bc0..0000000000 --- a/doc/build/changelog/unreleased_20/10967.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 10967 - - Fixed issue where using :meth:`_orm.Session.delete` along with the - :paramref:`_orm.Mapper.version_id_col` feature would fail to use the - correct version identifier in the case that an additional UPDATE were - emitted against the target object as a result of the use of - :paramref:`_orm.relationship.post_update` on the object. The issue is - similar to :ticket:`10800` just fixed in version 2.0.25 for the case of - updates alone. diff --git a/doc/build/changelog/unreleased_20/10990.rst b/doc/build/changelog/unreleased_20/10990.rst deleted file mode 100644 index ac887c8364..0000000000 --- a/doc/build/changelog/unreleased_20/10990.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 10990 - - Fixed issue where an assertion within the implementation for - :func:`_orm.with_expression` would raise if a SQL expression that was not - cacheable were used; this was a 2.0 regression since 1.4. diff --git a/doc/build/changelog/unreleased_20/9736.rst b/doc/build/changelog/unreleased_20/9736.rst deleted file mode 100644 index deb1703d87..0000000000 --- a/doc/build/changelog/unreleased_20/9736.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. change:: - :tags: postgresql, usecase - :tickets: 9736 - - Correctly type PostgreSQL RANGE and MULTIRANGE types as ``Range[T]`` - and ``Sequence[Range[T]]``. - Introduced utility sequence :class:`_postgresql.MultiRange` to allow better - interoperability of MULTIRANGE types. - -.. change:: - :tags: postgresql, usecase - - Differentiate between INT4 and INT8 ranges and multi-ranges types when - inferring the database type from a :class:`_postgresql.Range` or - :class:`_postgresql.MultiRange` instance, preferring INT4 if the values - fit into it. diff --git a/doc/build/changelog/unreleased_20/checkin_conn_none.rst b/doc/build/changelog/unreleased_20/checkin_conn_none.rst deleted file mode 100644 index 9aeed4784f..0000000000 --- a/doc/build/changelog/unreleased_20/checkin_conn_none.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. change:: - :tags: bug, typing - - Fixed the type signature for the :meth:`.PoolEvents.checkin` event to - indicate that the given :class:`.DBAPIConnection` argument may be ``None`` - in the case where the connection has been invalidated. diff --git a/doc/build/changelog/unreleased_20/examples.rst b/doc/build/changelog/unreleased_20/examples.rst deleted file mode 100644 index 8ac2c567ed..0000000000 --- a/doc/build/changelog/unreleased_20/examples.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, examples - - Fixed the performance example scripts in examples/performance to mostly - work with the Oracle database, by adding the :class:`.Identity` construct - to all the tables and allowing primary generation to occur on this backend. - A few of the "raw DBAPI" cases still are not compatible with Oracle. - diff --git a/doc/build/changelog/unreleased_20/uuid_imv_fixes.rst b/doc/build/changelog/unreleased_20/uuid_imv_fixes.rst deleted file mode 100644 index 0744c61e35..0000000000 --- a/doc/build/changelog/unreleased_20/uuid_imv_fixes.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. change:: - :tags: bug, mssql - - Fixed an issue regarding the use of the :class:`.Uuid` datatype with the - :paramref:`.Uuid.as_uuid` parameter set to False, when using the pymssql - dialect. ORM-optimized INSERT statements (e.g. the "insertmanyvalues" - feature) would not correctly align primary key UUID values for bulk INSERT - statements, resulting in errors. Similar issues were fixed for the - PostgreSQL drivers as well. - - -.. change:: - :tags: bug, postgresql - - Fixed an issue regarding the use of the :class:`.Uuid` datatype with the - :paramref:`.Uuid.as_uuid` parameter set to False, when using PostgreSQL - dialects. ORM-optimized INSERT statements (e.g. the "insertmanyvalues" - feature) would not correctly align primary key UUID values for bulk INSERT - statements, resulting in errors. Similar issues were fixed for the - pymssql driver as well.