2.0.40
Released: March 27, 2025
orm
-
[orm] [bug] Fixed regression which occurred as of 2.0.37 where the checked
ArgumentError
that's raised when an inappropriate type or object is used inside of aMapped
annotation would raiseTypeError
with "boolean value of this clause is not defined" if the object resolved into a SQL expression in a boolean context, for programs where future annotations mode was not enabled. This case is now handled explicitly and a new error message has also been tailored for this case. In addition, as there are at least half a dozen distinct error scenarios for intepretation of theMapped
construct, these scenarios have all been unified under a new subclass ofArgumentError
calledMappedAnnotationError
, to provide some continuity between these different scenarios, even though specific messaging remains distinct.References: #12329
-
[orm] [bug] Fixed regression in ORM Annotated Declarative class interpretation caused by
typing_extension==4.13.0
that introduced a different implementation forTypeAliasType
while SQLAlchemy assumed that it would be equivalent to thetyping
version, leading to pep-695 type annotations not resolving to SQL types as expected.References: #12473
sql
-
[sql] [usecase] Implemented support for the GROUPS frame specification in window functions by adding
_sql.over.groups
option to_sql.over()
andFunctionElement.over()
. Pull request courtesy Kaan Dikmen.References: #12450
-
[sql] [bug] Fixed issue in
CTE
constructs involving multiple DDL_sql.Insert
statements with multiple VALUES parameter sets where the bound parameter names generated for these parameter sets would conflict, generating a compile time error.References: #12363
-
[sql] [bug] Fixed regression caused by #7471 leading to a SQL compilation issue where name disambiguation for two same-named FROM clauses with table aliasing in use at the same time would produce invalid SQL in the FROM clause with two "AS" clauses for the aliased table, due to double aliasing.
References: #12451
asyncio
-
[asyncio] [bug] Fixed issue where
AsyncSession.get_transaction()
andAsyncSession.get_nested_transaction()
would fail withNotImplementedError
if the "proxy transaction" used byAsyncSession
were garbage collected and needed regeneration.References: #12471
postgresql
-
[postgresql] [usecase] Added support for specifying a list of columns for
SET NULL
andSET DEFAULT
actions ofON DELETE
clause of foreign key definition on PostgreSQL. Pull request courtesy Denis Laxalde.References: #11595
-
[postgresql] [usecase] When building a PostgreSQL
ARRAY
literal using_postgresql.array
with an emptyclauses
argument, the_postgresql.array.type_
parameter is now significant in that it will be used to render the resultingARRAY[]
SQL expression with a cast, such asARRAY[]::INTEGER
. Pull request courtesy Denis Laxalde.References: #12432
mysql
-
[mysql] [bug] Support has been re-added for the MySQL-Connector/Python DBAPI using the
mysql+mysqlconnector://
URL scheme. The DBAPI now works against modern MySQL versions as well as MariaDB versions (in the latter case it's required to pass charset/collation explicitly). Note however that server side cursor support is disabled due to unresolved issues with this driver.References: #12332
-
[mysql] [bug] Fixed issue in MySQL server default reflection where a default that has spaces would not be correctly reflected. Additionally, expanded the rules for when to apply parenthesis to a server default in DDL to suit the general case of a default string that contains non-word characters such as spaces or operators and is not a string literal.
References: #12425
sqlite
-
[sqlite] [bug] Expanded the rules for when to apply parenthesis to a server default in DDL to suit the general case of a default string that contains non-word characters such as spaces or operators and is not a string literal.
References: #12425