# SQLAlchemy rel_2_0_52 — 2.0.52 - Product: SQLAlchemy (https://whatsnew.fyi/product/sqlalchemy) - Vendor: SQLAlchemy - Date: 2026-08-11 - Version: rel_2_0_52 - Original notes: https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_2_0_52 - Permalink: https://whatsnew.fyi/product/sqlalchemy/releases/rel-2-0-52 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **added** — Python 3.15 support has been added and tested with minimal changes for full compatibility - **fixed** — Fixed a result-column misalignment bug in ORM-enabled UPDATE statements where synchronize_session="fetch" is in use, where columns in rows returned by .returning() could be returned under incorrect keys - **fixed** — Fixed bug where a failed bulk_insert_mappings(), bulk_update_mappings() or bulk_save_objects() call could leave the Session permanently in a flushing state - **fixed** — Fixed issue where unpickling an ORM object loaded using loader options with wildcard tokens would fail with KeyError or IndexError in separate processes - **fixed** — Fixed issue where a string ending in "*" passed to a Load strategy method would bypass the check rejecting string attribute names and now raises ArgumentError - **fixed** — Calling aliased() against a select() or union() / CompoundSelect construct now raises under SQLAlchemy 2.1 and emits a deprecation warning under SQLAlchemy 2.0 - **fixed** — Fixed issue where using PEP 593 Annotated wrapping a PEP 695 type alias would crash with AttributeError: __value__ - **fixed** — Fixed issue where Select.get_final_froms() would emit a spurious deprecation warning when the statement used the PostgreSQL-specific expression argument to Select.distinct() - **fixed** — Fixed an issue in Numeric where the decimal_return_scale parameter was ignored when the DBAPI does not support native decimal objects #### 2.0.52 Released: August 11, 2026 ##### platform - **[platform] [bug]** Python 3.15 support has been added and tested, including minimal changes for full compatibility. References: [#13477](https://www.sqlalchemy.org/trac/ticket/13477) ##### orm - **[orm] [bug]** Fixed a result-column misalignment bug in ORM-enabled UPDATE statements where `synchronize_session="fetch"` is in use, either explicitly or because the statement uses constructs such as CTEs that implicitly select for it. Columns in rows returned by `.returning()` could be returned under incorrect keys (e.g. `row[SomeClass.a]` returning the value of a different column), a problem most likely to manifest under concurrent workloads. ORM DELETE statements were not affected. References: [#13439](https://www.sqlalchemy.org/trac/ticket/13439) - **[orm] [bug]** Fixed bug where a failed `_orm.Session.bulk_insert_mappings()`, `_orm.Session.bulk_update_mappings()` or `_orm.Session.bulk_save_objects()` call could leave the `_orm.Session` permanently in a "flushing" state, such as when the transaction could not be begun because a previous flush had left it needing a rollback. Unlike `_orm.Session.flush()`, the bulk methods set the internal flushing flag and began the transaction outside of the `try`/`finally` block that resets it, so that neither `_orm.Session.rollback()` nor `_orm.Session.close()` would clear it, and every subsequent flush would raise `InvalidRequestError: Session is already flushing`. Pull request courtesy Hamody We. References: [#13485](https://www.sqlalchemy.org/trac/ticket/13485) - **[orm] [bug]** Fixed issue where unpickling an ORM object that were loaded using loader options making use of wildcard tokens, such as `_orm.load_only()` or `_orm.raiseload()` with `"*"`, would fail with `KeyError` or `IndexError` if the process doing the unpickling had not yet constructed a loader path making use of that same token. This would typically be observed when the object were unpickled in a separate process, such as with the `spawn` or `forkserver` multiprocessing start methods, the latter of which became the default on POSIX platforms as of Python 3.14. The internal collection of these tokens is now established up front, so that it is identical in every process. References: [#13493](https://www.sqlalchemy.org/trac/ticket/13493) - **[orm] [bug]** Fixed issue where a string ending in `"*"` passed to a `_orm.Load` strategy method, such as `Load(A).joinedload("bs.*")`, would bypass the check which rejects string attribute names in loader options, silently producing a loader path that matched nothing. Such a string now raises `ArgumentError` with the same message given for any other string attribute name. The bare wildcard `"*"`, as in `Load(A).lazyload("*")`, continues to be accepted. References: [#13493](https://www.sqlalchemy.org/trac/ticket/13493) - **[orm] [bug]** Calling `_orm.aliased()` against a `_sql.select()` or `_sql.union()` / `_sql.CompoundSelect` construct, which previously failed with an obscure `AttributeError` regarding a missing `.mapper` attribute, now raises when using SQLAlchemy 2.1, and emits a deprecation warning under SQLAlchemy 2.0 as it coerces the construct into a subquery instead. This matches the behavior of other similar implicit SELECT-to-FROM coercions. Pull request courtesy Rens Groothuijsen. References: [#6274](https://www.sqlalchemy.org/trac/ticket/6274) ##### orm declarative - **[bug] [orm declarative]** Fixed issue where using [PEP 593](https://peps.python.org/pep-0593) `Annotated` wrapping a [PEP 695](https://peps.python.org/pep-0695) `type` alias, such as `Annotated[SomeTypeAlias, mapped_column()]`, would crash with `AttributeError: __value__`. The internal `is_pep695()` check _[Truncated at 4000 characters — full notes: https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_2_0_52]_