Change8

rel_2_0_49

📦 sqlalchemyView on GitHub →
2 features🐛 7 fixes🔧 7 symbols

Summary

This release primarily focuses on bug fixes across the ORM, particularly concerning polymorphic loading and identity map usage. It also includes improvements to MSSQL dialect handling and typing resolution for better compatibility with modern typecheckers.

Migration Steps

  1. If relying on the specific return type resolution of :data:`.func` in typecheckers that strictly follow PEP 749, use the newly added differently-named type aliases for those return types.

✨ New Features

  • [mssql] Enhanced the aioodbc dialect to expose the fast_executemany attribute of the pyodbc cursor, allowing fast_executemany parameter to work with the mssql+aioodbc dialect.
  • [mssql] Removed warning for SQL Server dialect when a new version is detected, assuming compatibility issues with old FreeTDS versions are resolved.

🐛 Bug Fixes

  • [orm] Fixed issue where _orm.Session.get() would bypass the identity map and emit unnecessary SQL when with_for_update=False was passed.
  • [orm] Fixed issue where chained _orm.joinedload() options were not 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.
  • [orm] Fixed issue where using _orm.Load.options() to apply a chained loader option with _orm.PropComparator.of_type() for a polymorphic relationship would not generate necessary clauses for polymorphic subclasses.
  • [orm] 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.
  • [typing] Fixed a typing issue where typed members of .func returned the appropriate class, which caused issues for typecheckers following PEP 749 style resolution; added differently-named type aliases.
  • [postgresql] Fixed regular expression used when reflecting foreign keys in PostgreSQL to support escaped quotes in table names.
  • [mssql] Fixed regression where updated column reflection query received SQL Server "type alias" names (like sysname) instead of base names (like nvarchar), causing reflection failure for special types.

Affected Symbols