2.0.13
Released: May 10, 2023
orm
-
[orm] [bug] Fixed issue where ORM Annotated Declarative would not resolve forward
references correctly in all cases; in particular, when using
from __future__ import annotations
in combination with Pydantic
dataclasses.References: #9717
-
[orm] [bug] Fixed issue in new
orm_queryguide_upsert_returning
feature where the
populate_existing
execution option was not being propagated to the
loading option, preventing existing attributes from being refreshed
in-place.References: #9746
-
[orm] [bug] Fixed loader strategy pathing issues where eager loaders such as
_orm.joinedload()
/_orm.selectinload()
would fail to traverse
fully for many-levels deep following a load that had a
_orm.with_polymorphic()
or similar construct as an interim member.References: #9715
-
[orm] [bug] Fixed issue in
_orm.mapped_column()
construct where the correct
warning for "column X named directly multiple times" would not be emitted
when ORM mapped attributes referred to the same_schema.Column
, if
the_orm.mapped_column()
construct were involved, raising an internal
assertion instead.References: #9630
sql
-
[sql] [usecase] Implemented the "cartesian product warning" for UPDATE and DELETE
statements, those which include multiple tables that are not correlated
together in some way.References: #9721
-
[sql] [bug] Fixed the base class for dialect-specific float/double types; Oracle
_oracle.BINARY_DOUBLE
now subclasses_sqltypes.Double
,
and internal types for_sqltypes.Float
for asyncpg and pg8000 now
correctly subclass_sqltypes.Float
. -
[sql] [bug] Fixed issue where
_dml.update()
construct that included multiple
tables and no VALUES clause would raise with an internal error. Current
behavior for_dml.Update
with no values is to generate a SQL
UPDATE statement with an empty "set" clause, so this has been made
consistent for this specific sub-case.
schema
-
[schema] [performance] Improved how table columns are added, avoiding unnecessary allocations,
significantly speeding up the creation of many table, like when reflecting
entire schemas.References: #9597
typing
-
[typing] [bug] Fixed typing for the
_orm.Session.get.with_for_update
parameter
of_orm.Session.get()
and_orm.Session.refresh()
(as well as
corresponding methods on_asyncio.AsyncSession
) to accept boolean
True
and all other argument forms accepted by the parameter at runtime.References: #9762
-
[typing] [sql] Added type :data:
_sql.ColumnExpressionArgument
as a public-facing type
that indicates column-oriented arguments which are passed to SQLAlchemy
constructs, such as_sql.Select.where()
,_sql.and_()
and
others. This may be used to add typing to end-user functions which call
these methods.Unknown interpreted text role "data".
References: #9656
asyncio
-
[asyncio] [usecase] Added a new helper mixin
_asyncio.AsyncAttrs
that seeks to improve
the use of lazy-loader and other expired or deferred ORM attributes with
asyncio, providing a simple attribute accessor that provides anawait
interface to any ORM attribute, whether or not it needs to emit SQL.References: #9731
-
[asyncio] [bug] Fixed issue in semi-private
await_only()
andawait_fallback()
concurrency functions where the given awaitable would remain un-awaited if
the function threw aGreenletError
, which could cause "was not awaited"
warnings later on if the program continued. In this case, the given
awaitable is now cancelled before the exception is thrown.
postgresql
-
[postgresql] [bug] [regression] Fixed another regression due to the "insertmanyvalues" change in 2.0.10 as
part of #9618, in a similar way as regression #9701, where
LargeBinary
datatypes also need additional casts on when using the
asyncpg driver specifically in order to work with the new bulk INSERT
format.References: #9739
oracle
-
[oracle] [reflection] Added reflection support in the Oracle dialect to expression based indexes
and the ordering direction of index expressions.References: #9597
misc
-
[bug] [ext] Fixed issue in
_mutable.Mutable
where event registration for ORM
mapped attributes would be called repeatedly for mapped inheritance
subclasses, leading to duplicate events being invoked in inheritance
hierarchies.References: #9676