1.4.6
Released: April 6, 2021
orm
-
[orm] [bug] [regression] Fixed regression where a deprecated form of
_orm.Query.join()
were
used, passing a series of entities to join from without any ON clause in a
single_orm.Query.join()
call, would fail to function correctly.References: #6203
-
[orm] [bug] [regression] Fixed critical regression where the
_orm.Query.yield_per()
method in
the ORM would set up the internal_engine.Result
to yield chunks
at a time, however made use of the new_engine.Result.unique()
method
which uniques across the entire result. This would lead to lost rows since
the ORM is usingid(obj)
as the uniquing function, which leads to
repeated identifiers for new objects as already-seen objects are garbage
collected. 1.3's behavior here was to "unique" across each chunk, which
does not actually produce "uniqued" results when results are yielded in
chunks. As the_orm.Query.yield_per()
method is already explicitly
disallowed when joined eager loading is in place, which is the primary
rationale for the "uniquing" feature, the "uniquing" feature is now turned
off entirely when_orm.Query.yield_per()
is used.This regression only applies to the legacy
_orm.Query
object; when
using :term:2.0 style
execution, "uniquing" is not automatically applied.
To prevent the issue from arising from explicit use of
_engine.Result.unique()
, an error is now raised if rows are fetched
from a "uniqued" ORM-level_engine.Result
if any
yield per <orm_queryguide_yield_per>
API is also in use, as the
purpose ofyield_per
is to allow for arbitrarily large numbers of rows,
which cannot be uniqued in memory without growing the number of entries to
fit the complete result size.Unknown interpreted text role "term".
References: #6206
sql
-
[sql] [bug] [mssql] [oracle] [regression] Fixed further regressions in the same area as that of #6173 released in
1.4.5, where a "postcompile" parameter, again most typically those used for
LIMIT/OFFSET rendering in Oracle and SQL Server, would fail to be processed
correctly if the same parameter rendered in multiple places in the
statement.References: #6202
-
[sql] [bug] Executing a
_sql.Subquery
using_engine.Connection.execute()
is deprecated and will emit a deprecation warning; this use case was an
oversight that should have been removed from 1.4. The operation will now
execute the underlying_sql.Select
object directly for backwards
compatibility. Similarly, the_sql.CTE
class is also not
appropriate for execution. In 1.3, attempting to execute a CTE would result
in an invalid "blank" SQL statement being executed; since this use case was
not working it now raises_exc.ObjectNotExecutableError
.
Previously, 1.4 was attempting to execute the CTE as a statement however it
was working only erratically.References: #6204
schema
-
[schema] [bug] The
_schema.Table
object now raises an informative error message if
it is instantiated without passing at least the_schema.Table.name
and_schema.Table.metadata
arguments positionally. Previously, if
these were passed as keyword arguments, the object would silently fail to
initialize correctly.This change is also backported to: 1.3.25
References: #6135
mypy
-
[mypy] [bug] Applied a series of refactorings and fixes to accommodate for Mypy
"incremental" mode across multiple files, which previously was not taken
into account. In this mode the Mypy plugin has to accommodate Python
datatypes expressed in other files coming in with less information than
they have on a direct run.Additionally, a new decorator
_orm.declarative_mixin()
is added,
which is necessary for the Mypy plugin to be able to definifitely identify
a Declarative mixin class that is otherwise not used inside a particular
Python file.References: #6147
-
[mypy] [bug] Fixed issue where the Mypy plugin would fail to interpret the
"collection_class" of a relationship if it were a callable and not a class.
Also improved type matching and error reporting for collection-oriented
relationships.References: #6205
asyncio
-
[asyncio] [usecase] [postgresql] Added accessors
.sqlstate
and synonym.pgcode
to the.orig
attribute of the SQLAlchemy exception class raised by the asyncpg DBAPI
adapter, that is, the intermediary exception object that wraps on top of
that raised by the asyncpg library itself, but below the level of the
SQLAlchemy dialect.References: #6199