News and Updates

SQLAlchemy 2.1.6 Released
permalink

SQLAlchemy 2.1.6 is now available.

Release 2.1.6 fixes two ORM regressions in the 2.1 series, one involving multiple with_loader_criteria() options that refer to the same entity in correlated subqueries, and another where .params() would not be applied to statements created using Select.from_statement() when the compiled cache is not in use. The release also contains several fixes that are also backported to the 2.0.x series including more asyncio fixes as well as fixes involving statement caching and dynamic "expanding" parameters for "IN" expressions.

The detailed changelog for 2.1.6 is at Changelog.

SQLAlchemy 2.1.6 is available on the Download Page.

SQLAlchemy 2.1.5 Released
permalink

SQLAlchemy 2.1.5 is now available.

Release 2.1.5 contains additional fixes for asyncio task cancellation. As mentioned in the release announcement for 2.0.55, we've recently received and fixed lots of bug reports involving asyncio and task cancellation, as these difficult-to-catch, difficult-to-reproduce bugs are now being reported using large language models that are able to isolate each issue into a reproducing test case.

The detailed changelog for 2.1.5 is at Changelog.

SQLAlchemy 2.1.5 is available on the Download Page.

SQLAlchemy 2.0.55 Released
permalink

SQLAlchemy 2.0.55 is now available.

Release 2.0.55 contains a series of bugfixes backported from the 2.1.x series. Of particular note are many fixes involving correct handling of asyncio task cancellation with active database connections as well as garbage collection surrounding connections (particularly asyncio connections) and cursors.

Task-cancellation and garbage collection issues that were previously difficult or impossible to reproduce are now being reported by users at a dramatically higher rate. There are two factors at play in this change. One is that while Python asyncio programming is typically straightforward when dealing with IO streams and await keywords, the presence of the task.cancel() and CancelledError constructs adds a deeply complex layer to asyncio applications, turning every await into a potential source of an exception that requires context-specific cleanup of all resources and proper re-propagation when it occurs. The other is that these issues were previously very difficult to report as they are transient and often nearly impossible to reproduce, and when they were reported we were often unable to reproduce them. However, with the advent of large language models, users can now isolate report these issues with accurate reproduction cases, allowing them to be fixed.

As a result of these new capabilities, SQLAlchemy's internal testing now makes use of a test harness that exercises a task.cancel() scenario at every await along an entire chain of operations, ensuring that for each one, database connections are not "leaked" whether or not they are marked as invalid, and the original CancelledError is correctly propagated.

The detailed changelog for 2.0.55 is at Changelog.

SQLAlchemy 2.0.55 is available on the Download Page.

SQLAlchemy 2.1.4 Released
permalink

SQLAlchemy 2.1.4 is now available.

With many more environments upgrading to the 2.1 series we finally have a few more regressions to fix; release 2.1.4 has an array of fixes that are both 2.1-specific as well as some that are in the 2.0 series as well.

The detailed changelog for 2.1.4 is at Changelog.

SQLAlchemy 2.1.4 is available on the Download Page.

SQLAlchemy 2.1.2 Released
permalink

SQLAlchemy 2.1.2 is now available.

Release 2.1.2 fixes regressions that have been reported since the release as well as makes one adjustment to the new t-string feature. This release includes a critical regression fix to the selectinload() loader strategy; all users of the new 2.1 series are encouraged to upgrade to 2.1.2.

The detailed changelog for 2.1.2 is at Changelog.

SQLAlchemy 2.1.2 is available on the Download Page.