2.0.49
Released: April 3, 2026
orm
-
[orm] [bug] Fixed issue where
_orm.Session.get()would bypass the identity map and emit unnecessary SQL whenwith_for_update=Falsewas passed, rather than treating it equivalently to the default ofNone. Pull request courtesy of Joshua Swanson.References: #13176
-
[orm] [bug] Fixed issue where chained
_orm.joinedload()options would not be applied correctly when the final relationship in the chain is declared on a base mapper and accessed through a subclass mapper in a_orm.with_polymorphic()query. The path registry now correctly computes the natural path when a property declared on a base class is accessed through a path containing a subclass mapper, ensuring the loader option can be located during query compilation.References: #13193
-
[orm] [bug] [inheritance] Fixed issue where using
_orm.Load.options()to apply a chained loader option such as_orm.joinedload()or_orm.selectinload()with_orm.PropComparator.of_type()for a polymorphic relationship would not generate the necessary clauses for the polymorphic subclasses. The polymorphic loading strategy is now correctly propagated when using a call such asjoinedload(A.b).options(joinedload(B.c.of_type(poly)))to match the behavior of direct chaining e.g.joinedload(A.b).joinedload(B.c.of_type(poly)).References: #13202
-
[orm] [bug] [inheritance] Fixed issue where using chained loader options such as
_orm.selectinload()after_orm.joinedload()with_orm.PropComparator.of_type()for a polymorphic relationship would not properly apply the chained loader option. The loader option is now correctly applied when using a call such asjoinedload(A.b.of_type(poly)).selectinload(poly.SubClass.c)to eagerly load related objects.References: #13209
typing
-
[typing] [bug] Fixed a typing issue where the typed members of :data:
.funcwould return the appropriate class of the same name, however this creates an issue for typecheckers such as Zuban and pyrefly that assume PEP 749 style typechecking even if the file states that it's a PEP 563 file; they see the returned name as indicating the method object and not the class object. These typecheckers are actually following along with an upcoming test harness that insists on PEP 749 style name resolution for this case unconditionally. Since PEP 749 is the way of the future regardless, differently-named type aliases have been added for these return types.Unknown interpreted text role "data".
References: #13167
postgresql
-
[postgresql] [bug] Fixed regular expression used when reflecting foreign keys in PostgreSQL to support escaped quotes in table names. Pull request courtesy of Austin Graham
References: #10902
mssql
-
[mssql] [usecase] Enhanced the
aioodbcdialect to expose thefast_executemanyattribute of the pyodbc cursor. This allows thefast_executemanyparameter to work with themssql+aioodbcdialect. Pull request courtesy Georg Sieber.References: #13152
-
[mssql] [usecase] Remove warning for SQL Server dialect when a new version is detected. The warning was originally added more than 15 years ago due to an unexpected value returned when using an old version of FreeTDS. The assumption is that since then the issue has been resolved, so make the SQL Server dialect behave like the other ones that don't have an upper bound check on the version number.
References: #13185
-
[mssql] [bug] [reflection] Fixed regression from version 2.0.42 caused by #12654 where the updated column reflection query would receive SQL Server "type alias" names for special types such as
sysname, whereas previously the base name would be received (e.g.nvarcharforsysname), leading to warnings that such types could not be reflected and resulting inNullType, rather than the expectedNVARCHARfor a type likesysname. The column reflection query now joinssys.typesa second time to look up the base type when the user type name is not present inMSDialect.ischema_names, and both names are checked inMSDialect.ischema_namesfor a match. Pull request courtesy Carlos Serrano.
oracle
-
[oracle] [bug] Fixed issue in Oracle dialect where the
_oracle.RAWdatatype would not reflect the length parameter. Pull request courtesy Daniel Sullivan.References: #13150