From 29e4255f413b9791e117b40ab12c76c9df6313d8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 10 Oct 2025 10:29:58 -0400 Subject: [PATCH] - 2.0.44 --- doc/build/changelog/changelog_20.rst | 196 +++++++++++++++++- doc/build/changelog/unreleased_20/12271.rst | 8 - doc/build/changelog/unreleased_20/12273.rst | 6 - doc/build/changelog/unreleased_20/12798.rst | 15 -- doc/build/changelog/unreleased_20/12802.rst | 8 - doc/build/changelog/unreleased_20/12813.rst | 12 -- doc/build/changelog/unreleased_20/12829.rst | 28 --- doc/build/changelog/unreleased_20/12847.rst | 8 - doc/build/changelog/unreleased_20/12855.rst | 8 - doc/build/changelog/unreleased_20/12864.rst | 10 - doc/build/changelog/unreleased_20/12874.rst | 11 - doc/build/changelog/unreleased_20/12881.rst | 15 -- doc/build/changelog/unreleased_20/12884.rst | 11 - doc/build/changelog/unreleased_20/12894.rst | 9 - doc/build/changelog/unreleased_20/12905.rst | 12 -- doc/build/changelog/unreleased_20/12907.rst | 12 -- .../changelog/unreleased_20/unblock314.rst | 5 - doc/build/conf.py | 4 +- 18 files changed, 197 insertions(+), 181 deletions(-) delete mode 100644 doc/build/changelog/unreleased_20/12271.rst delete mode 100644 doc/build/changelog/unreleased_20/12273.rst delete mode 100644 doc/build/changelog/unreleased_20/12798.rst delete mode 100644 doc/build/changelog/unreleased_20/12802.rst delete mode 100644 doc/build/changelog/unreleased_20/12813.rst delete mode 100644 doc/build/changelog/unreleased_20/12829.rst delete mode 100644 doc/build/changelog/unreleased_20/12847.rst delete mode 100644 doc/build/changelog/unreleased_20/12855.rst delete mode 100644 doc/build/changelog/unreleased_20/12864.rst delete mode 100644 doc/build/changelog/unreleased_20/12874.rst delete mode 100644 doc/build/changelog/unreleased_20/12881.rst delete mode 100644 doc/build/changelog/unreleased_20/12884.rst delete mode 100644 doc/build/changelog/unreleased_20/12894.rst delete mode 100644 doc/build/changelog/unreleased_20/12905.rst delete mode 100644 doc/build/changelog/unreleased_20/12907.rst delete mode 100644 doc/build/changelog/unreleased_20/unblock314.rst diff --git a/doc/build/changelog/changelog_20.rst b/doc/build/changelog/changelog_20.rst index a8e76a33c2..6590439fef 100644 --- a/doc/build/changelog/changelog_20.rst +++ b/doc/build/changelog/changelog_20.rst @@ -10,7 +10,201 @@ .. changelog:: :version: 2.0.44 - :include_notes_from: unreleased_20 + :released: October 10, 2025 + + .. change:: + :tags: bug, sql + :tickets: 12271 + + Improved the implementation of :meth:`.UpdateBase.returning` to use more + robust logic in setting up the ``.c`` collection of a derived statement + such as a CTE. This fixes issues related to RETURNING clauses that feature + expressions based on returned columns with or without qualifying labels. + + .. change:: + :tags: usecase, asyncio + :tickets: 12273 + + Generalize the terminate logic employed by the asyncpg dialect to reuse + it in the aiomysql and asyncmy dialect implementation. + + .. change:: + :tags: bug, mssql + :tickets: 12798 + + Improved the base implementation of the asyncio cursor such that it + includes the option for the underlying driver's cursor to be actively + closed in those cases where it requires ``await`` in order to complete the + close sequence, rather than relying on garbage collection to "close" it, + when a plain :class:`.Result` is returned that does not use ``await`` for + any of its methods. The previous approach of relying on gc was fine for + MySQL and SQLite dialects but has caused problems with the aioodbc + implementation on top of SQL Server. The new option is enabled + for those dialects which have an "awaitable" ``cursor.close()``, which + includes the aioodbc, aiomysql, and asyncmy dialects (aiosqlite is also + modified for 2.1 only). + + .. change:: + :tags: bug, ext + :tickets: 12802 + + Fixed issue caused by an unwanted functional change while typing + the :class:`.MutableList` class. + This change also reverts all other functional changes done in + the same change. + + .. change:: + :tags: bug, typing + :tickets: 12813 + + Fixed typing bug where the :meth:`.Session.execute` method advertised that + it would return a :class:`.CursorResult` if given an insert/update/delete + statement. This is not the general case as several flavors of ORM + insert/update do not actually yield a :class:`.CursorResult` which cannot + be differentiated at the typing overload level, so the method now yields + :class:`.Result` in all cases. For those cases where + :class:`.CursorResult` is known to be returned and the ``.rowcount`` + attribute is required, please use ``typing.cast()``. + + .. change:: + :tags: usecase, orm + :tickets: 12829 + + The way ORM Annotated Declarative interprets Python :pep:`695` type aliases + in ``Mapped[]`` annotations has been refined to expand the lookup scheme. A + :pep:`695` type can now be resolved based on either its direct presence in + :paramref:`_orm.registry.type_annotation_map` or its immediate resolved + value, as long as a recursive lookup across multiple :pep:`695` types is + not required for it to resolve. This change reverses part of the + restrictions introduced in 2.0.37 as part of :ticket:`11955`, which + deprecated (and disallowed in 2.1) the ability to resolve any :pep:`695` + type that was not explicitly present in + :paramref:`_orm.registry.type_annotation_map`. Recursive lookups of + :pep:`695` types remains deprecated in 2.0 and disallowed in version 2.1, + as do implicit lookups of ``NewType`` types without an entry in + :paramref:`_orm.registry.type_annotation_map`. + + Additionally, new support has been added for generic :pep:`695` aliases that + refer to :pep:`593` ``Annotated`` constructs containing + :func:`_orm.mapped_column` configurations. See the sections below for + examples. + + .. seealso:: + + :ref:`orm_declarative_type_map_pep695_types` + + :ref:`orm_declarative_mapped_column_generic_pep593` + + .. change:: + :tags: bug, postgresql + :tickets: 12847 + + Fixed issue where selecting an enum array column containing NULL values + would fail to parse properly in the PostgreSQL dialect. The + :func:`._split_enum_values` function now correctly handles NULL entries by + converting them to Python ``None`` values. + + .. change:: + :tags: bug, typing + :tickets: 12855 + + Added new decorator :func:`_orm.mapped_as_dataclass`, which is a function + based form of :meth:`_orm.registry.mapped_as_dataclass`; the method form + :meth:`_orm.registry.mapped_as_dataclass` does not seem to be correctly + recognized within the scope of :pep:`681` in recent mypy versions. + + .. change:: + :tags: bug, sqlite + :tickets: 12864 + + Fixed issue where SQLite table reflection would fail for tables using + ``WITHOUT ROWID`` and/or ``STRICT`` table options when the table contained + generated columns. The regular expression used to parse ``CREATE TABLE`` + statements for generated column detection has been updated to properly + handle these SQLite table options that appear after the column definitions. + Pull request courtesy Tip ten Brink. + + .. change:: + :tags: bug, postgresql + :tickets: 12874 + + Fixed issue where the :func:`_sql.any_` and :func:`_sql.all_` aggregation + operators would not correctly coerce the datatype of the compared value, in + those cases where the compared value were not a simple int/str etc., such + as a Python ``Enum`` or other custom value. This would lead to execution + time errors for these values. This issue is essentially the same as + :ticket:`6515` which was for the now-legacy :meth:`.ARRAY.any` and + :meth:`.ARRAY.all` methods. + + .. change:: + :tags: bug, engine + :tickets: 12881 + + Implemented initial support for free-threaded Python by adding new tests + and reworking the test harness to include Python 3.13t and Python 3.14t in + test runs. Two concurrency issues have been identified and fixed: the first + involves initialization of the ``.c`` collection on a ``FromClause``, a + continuation of :ticket:`12302`, where an optional mutex under + free-threading is added; the second involves synchronization of the pool + "first_connect" event, which first received thread synchronization in + :ticket:`2964`, however under free-threading the creation of the mutex + itself runs under the same free-threading mutex. Support for free-threaded + wheels on Pypi is implemented as well within the 2.1 series only. Initial + pull request and test suite courtesy Lysandros Nikolaou. + + .. change:: + :tags: bug, schema + :tickets: 12884 + + Fixed issue where :meth:`_schema.MetaData.reflect` did not forward + dialect-specific keyword arguments to the :class:`_engine.Inspector` + methods, causing options like ``oracle_resolve_synonyms`` to be ignored + during reflection. The method now ensures that all extra kwargs passed to + :meth:`_schema.MetaData.reflect` are forwarded to + :meth:`_engine.Inspector.get_table_names` and related reflection methods. + Pull request courtesy Lukáš Kožušník. + + .. change:: + :tags: bug, mssql + :tickets: 12894 + + Fixed issue where the index reflection for SQL Server would + not correctly return the order of the column inside an index + when the order of the columns in the index did not match the + order of the columns in the table. + Pull request courtesy of Allen Chen. + + .. change:: + :tags: bug, orm + :tickets: 12905 + + Fixed a caching issue where :func:`_orm.with_loader_criteria` would + incorrectly reuse cached bound parameter values when used with + :class:`_sql.CompoundSelect` constructs such as :func:`_sql.union`. The + issue was caused by the cache key for compound selects not including the + execution options that are part of the :class:`_sql.Executable` base class, + which :func:`_orm.with_loader_criteria` uses to apply its criteria + dynamically. The fix ensures that compound selects and other executable + constructs properly include execution options in their cache key traversal. + + .. change:: + :tags: bug, mssql, reflection + :tickets: 12907 + + Fixed issue in the MSSQL dialect's foreign key reflection query where + duplicate rows could be returned when a foreign key column and its + referenced primary key column have the same name, and both the referencing + and referenced tables have indexes with the same name. This resulted in an + "ForeignKeyConstraint with duplicate source column references are not + supported" error when attempting to reflect such tables. The query has been + corrected to exclude indexes on the child table when looking for unique + indexes referenced by foreign keys. + + .. change:: + :tags: bug, platform + + Unblocked automatic greenlet installation for Python 3.14 now that + there are greenlet wheels on pypi for python 3.14. .. changelog:: :version: 2.0.43 diff --git a/doc/build/changelog/unreleased_20/12271.rst b/doc/build/changelog/unreleased_20/12271.rst deleted file mode 100644 index 1cc53cf6de..0000000000 --- a/doc/build/changelog/unreleased_20/12271.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 12271 - - Improved the implementation of :meth:`.UpdateBase.returning` to use more - robust logic in setting up the ``.c`` collection of a derived statement - such as a CTE. This fixes issues related to RETURNING clauses that feature - expressions based on returned columns with or without qualifying labels. diff --git a/doc/build/changelog/unreleased_20/12273.rst b/doc/build/changelog/unreleased_20/12273.rst deleted file mode 100644 index 754677afaa..0000000000 --- a/doc/build/changelog/unreleased_20/12273.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. change:: - :tags: usecase, asyncio - :tickets: 12273 - - Generalize the terminate logic employed by the asyncpg dialect to reuse - it in the aiomysql and asyncmy dialect implementation. diff --git a/doc/build/changelog/unreleased_20/12798.rst b/doc/build/changelog/unreleased_20/12798.rst deleted file mode 100644 index 0161026200..0000000000 --- a/doc/build/changelog/unreleased_20/12798.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. change:: - :tags: bug, mssql - :tickets: 12798 - - Improved the base implementation of the asyncio cursor such that it - includes the option for the underlying driver's cursor to be actively - closed in those cases where it requires ``await`` in order to complete the - close sequence, rather than relying on garbage collection to "close" it, - when a plain :class:`.Result` is returned that does not use ``await`` for - any of its methods. The previous approach of relying on gc was fine for - MySQL and SQLite dialects but has caused problems with the aioodbc - implementation on top of SQL Server. The new option is enabled - for those dialects which have an "awaitable" ``cursor.close()``, which - includes the aioodbc, aiomysql, and asyncmy dialects (aiosqlite is also - modified for 2.1 only). diff --git a/doc/build/changelog/unreleased_20/12802.rst b/doc/build/changelog/unreleased_20/12802.rst deleted file mode 100644 index 752326b8af..0000000000 --- a/doc/build/changelog/unreleased_20/12802.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, ext - :tickets: 12802 - - Fixed issue caused by an unwanted functional change while typing - the :class:`.MutableList` class. - This change also reverts all other functional changes done in - the same change. diff --git a/doc/build/changelog/unreleased_20/12813.rst b/doc/build/changelog/unreleased_20/12813.rst deleted file mode 100644 index e478372a11..0000000000 --- a/doc/build/changelog/unreleased_20/12813.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. change:: - :tags: bug, typing - :tickets: 12813 - - Fixed typing bug where the :meth:`.Session.execute` method advertised that - it would return a :class:`.CursorResult` if given an insert/update/delete - statement. This is not the general case as several flavors of ORM - insert/update do not actually yield a :class:`.CursorResult` which cannot - be differentiated at the typing overload level, so the method now yields - :class:`.Result` in all cases. For those cases where - :class:`.CursorResult` is known to be returned and the ``.rowcount`` - attribute is required, please use ``typing.cast()``. diff --git a/doc/build/changelog/unreleased_20/12829.rst b/doc/build/changelog/unreleased_20/12829.rst deleted file mode 100644 index 5dd8d3e9d4..0000000000 --- a/doc/build/changelog/unreleased_20/12829.rst +++ /dev/null @@ -1,28 +0,0 @@ -.. change:: - :tags: usecase, orm - :tickets: 12829 - - The way ORM Annotated Declarative interprets Python :pep:`695` type aliases - in ``Mapped[]`` annotations has been refined to expand the lookup scheme. A - :pep:`695` type can now be resolved based on either its direct presence in - :paramref:`_orm.registry.type_annotation_map` or its immediate resolved - value, as long as a recursive lookup across multiple :pep:`695` types is - not required for it to resolve. This change reverses part of the - restrictions introduced in 2.0.37 as part of :ticket:`11955`, which - deprecated (and disallowed in 2.1) the ability to resolve any :pep:`695` - type that was not explicitly present in - :paramref:`_orm.registry.type_annotation_map`. Recursive lookups of - :pep:`695` types remains deprecated in 2.0 and disallowed in version 2.1, - as do implicit lookups of ``NewType`` types without an entry in - :paramref:`_orm.registry.type_annotation_map`. - - Additionally, new support has been added for generic :pep:`695` aliases that - refer to :pep:`593` ``Annotated`` constructs containing - :func:`_orm.mapped_column` configurations. See the sections below for - examples. - - .. seealso:: - - :ref:`orm_declarative_type_map_pep695_types` - - :ref:`orm_declarative_mapped_column_generic_pep593` diff --git a/doc/build/changelog/unreleased_20/12847.rst b/doc/build/changelog/unreleased_20/12847.rst deleted file mode 100644 index bba7849d3e..0000000000 --- a/doc/build/changelog/unreleased_20/12847.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 12847 - - Fixed issue where selecting an enum array column containing NULL values - would fail to parse properly in the PostgreSQL dialect. The - :func:`._split_enum_values` function now correctly handles NULL entries by - converting them to Python ``None`` values. diff --git a/doc/build/changelog/unreleased_20/12855.rst b/doc/build/changelog/unreleased_20/12855.rst deleted file mode 100644 index c33110ad0e..0000000000 --- a/doc/build/changelog/unreleased_20/12855.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, typing - :tickets: 12855 - - Added new decorator :func:`_orm.mapped_as_dataclass`, which is a function - based form of :meth:`_orm.registry.mapped_as_dataclass`; the method form - :meth:`_orm.registry.mapped_as_dataclass` does not seem to be correctly - recognized within the scope of :pep:`681` in recent mypy versions. diff --git a/doc/build/changelog/unreleased_20/12864.rst b/doc/build/changelog/unreleased_20/12864.rst deleted file mode 100644 index f8d1e5b44e..0000000000 --- a/doc/build/changelog/unreleased_20/12864.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: bug, sqlite - :tickets: 12864 - - Fixed issue where SQLite table reflection would fail for tables using - ``WITHOUT ROWID`` and/or ``STRICT`` table options when the table contained - generated columns. The regular expression used to parse ``CREATE TABLE`` - statements for generated column detection has been updated to properly - handle these SQLite table options that appear after the column definitions. - Pull request courtesy Tip ten Brink. diff --git a/doc/build/changelog/unreleased_20/12874.rst b/doc/build/changelog/unreleased_20/12874.rst deleted file mode 100644 index 2d802203ec..0000000000 --- a/doc/build/changelog/unreleased_20/12874.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 12874 - - Fixed issue where the :func:`_sql.any_` and :func:`_sql.all_` aggregation - operators would not correctly coerce the datatype of the compared value, in - those cases where the compared value were not a simple int/str etc., such - as a Python ``Enum`` or other custom value. This would lead to execution - time errors for these values. This issue is essentially the same as - :ticket:`6515` which was for the now-legacy :meth:`.ARRAY.any` and - :meth:`.ARRAY.all` methods. diff --git a/doc/build/changelog/unreleased_20/12881.rst b/doc/build/changelog/unreleased_20/12881.rst deleted file mode 100644 index b4cc31df3e..0000000000 --- a/doc/build/changelog/unreleased_20/12881.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. change:: - :tags: bug, engine - :tickets: 12881 - - Implemented initial support for free-threaded Python by adding new tests - and reworking the test harness to include Python 3.13t and Python 3.14t in - test runs. Two concurrency issues have been identified and fixed: the first - involves initialization of the ``.c`` collection on a ``FromClause``, a - continuation of :ticket:`12302`, where an optional mutex under - free-threading is added; the second involves synchronization of the pool - "first_connect" event, which first received thread synchronization in - :ticket:`2964`, however under free-threading the creation of the mutex - itself runs under the same free-threading mutex. Support for free-threaded - wheels on Pypi is implemented as well within the 2.1 series only. Initial - pull request and test suite courtesy Lysandros Nikolaou. diff --git a/doc/build/changelog/unreleased_20/12884.rst b/doc/build/changelog/unreleased_20/12884.rst deleted file mode 100644 index 71dc55644d..0000000000 --- a/doc/build/changelog/unreleased_20/12884.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, schema - :tickets: 12884 - - Fixed issue where :meth:`_schema.MetaData.reflect` did not forward - dialect-specific keyword arguments to the :class:`_engine.Inspector` - methods, causing options like ``oracle_resolve_synonyms`` to be ignored - during reflection. The method now ensures that all extra kwargs passed to - :meth:`_schema.MetaData.reflect` are forwarded to - :meth:`_engine.Inspector.get_table_names` and related reflection methods. - Pull request courtesy Lukáš Kožušník. diff --git a/doc/build/changelog/unreleased_20/12894.rst b/doc/build/changelog/unreleased_20/12894.rst deleted file mode 100644 index 43cbd74b79..0000000000 --- a/doc/build/changelog/unreleased_20/12894.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, mssql - :tickets: 12894 - - Fixed issue where the index reflection for SQL Server would - not correctly return the order of the column inside an index - when the order of the columns in the index did not match the - order of the columns in the table. - Pull request courtesy of Allen Chen. diff --git a/doc/build/changelog/unreleased_20/12905.rst b/doc/build/changelog/unreleased_20/12905.rst deleted file mode 100644 index e99a14e66c..0000000000 --- a/doc/build/changelog/unreleased_20/12905.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 12905 - - Fixed a caching issue where :func:`_orm.with_loader_criteria` would - incorrectly reuse cached bound parameter values when used with - :class:`_sql.CompoundSelect` constructs such as :func:`_sql.union`. The - issue was caused by the cache key for compound selects not including the - execution options that are part of the :class:`_sql.Executable` base class, - which :func:`_orm.with_loader_criteria` uses to apply its criteria - dynamically. The fix ensures that compound selects and other executable - constructs properly include execution options in their cache key traversal. diff --git a/doc/build/changelog/unreleased_20/12907.rst b/doc/build/changelog/unreleased_20/12907.rst deleted file mode 100644 index b89c98f358..0000000000 --- a/doc/build/changelog/unreleased_20/12907.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. change:: - :tags: bug, mssql, reflection - :tickets: 12907 - - Fixed issue in the MSSQL dialect's foreign key reflection query where - duplicate rows could be returned when a foreign key column and its - referenced primary key column have the same name, and both the referencing - and referenced tables have indexes with the same name. This resulted in an - "ForeignKeyConstraint with duplicate source column references are not - supported" error when attempting to reflect such tables. The query has been - corrected to exclude indexes on the child table when looking for unique - indexes referenced by foreign keys. diff --git a/doc/build/changelog/unreleased_20/unblock314.rst b/doc/build/changelog/unreleased_20/unblock314.rst deleted file mode 100644 index 6759aacf4b..0000000000 --- a/doc/build/changelog/unreleased_20/unblock314.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. change:: - :tags: bug, platform - - Unblocked automatic greenlet installation for Python 3.14 now that - there are greenlet wheels on pypi for python 3.14. diff --git a/doc/build/conf.py b/doc/build/conf.py index 4d032c3279..65a59a4c3f 100644 --- a/doc/build/conf.py +++ b/doc/build/conf.py @@ -239,9 +239,9 @@ copyright = "2007-2025, the SQLAlchemy authors and contributors" # noqa # The short X.Y version. version = "2.0" # The full version, including alpha/beta/rc tags. -release = "2.0.43" +release = "2.0.44" -release_date = "August 11, 2025" +release_date = "October 10, 2025" site_base = os.environ.get("RTD_SITE_BASE", "https://www.sqlalchemy.org") site_adapter_template = "docs_adapter.mako" -- 2.47.3