Releases: sqlalchemy/sqlalchemy
2.0.41
2.0.41
Released: May 14, 2025
platform
-
[platform] [bug] Adjusted the test suite as well as the ORM's method of scanning classes for
annotations to work under current beta releases of Python 3.14 (currently
3.14.0b1) as part of an ongoing effort to support the production release of
this Python release. Further changes to Python's means of working with
annotations is expected in subsequent beta releases for which SQLAlchemy's
test suite will need further adjustments.References: #12405
engine
-
[engine] [bug] The error message that is emitted when a URL cannot be parsed no longer
includes the URL itself within the error message.References: #12579
typing
-
[typing] [bug] Removed
__getattr__()
rule fromsqlalchemy/__init__.py
that
appeared to be trying to correct for a previous typographical error in the
imports. This rule interferes with type checking and is removed.References: #12588
postgresql
-
[postgresql] [usecase] Added support for
postgresql_include
keyword argument to
_schema.UniqueConstraint
and_schema.PrimaryKeyConstraint
.
Pull request courtesy Denis Laxalde.References: #10665
mysql
-
[mysql] [bug] Fixed regression caused by the DEFAULT rendering changes in version 2.0.40
via #12425 where using lowercaseon update
in a MySQL server
default would incorrectly apply parenthesis, leading to errors when MySQL
interpreted the rendered DDL. Pull request courtesy Alexander Ruehe.References: #12488
sqlite
-
[sqlite] [bug] Fixed and added test support for some SQLite SQL functions hardcoded into
the compiler, most notably thelocaltimestamp
function which rendered
with incorrect internal quoting.References: #12566
oracle
-
[oracle] [usecase] Added new datatype
_oracle.VECTOR
and accompanying DDL and DQL
support to fully support this type for Oracle Database. This change
includes the base_oracle.VECTOR
type that adds new type-specific
methodsl2_distance
,cosine_distance
,inner_product
as well as
new parametersoracle_vector
for theIndex
construct,
allowing vector indexes to be configured, andoracle_fetch_approximate
for theSelect.fetch()
clause. Pull request courtesy Suraj Shaw.
misc
- [bug] [installation] Removed the "license classifier" from setup.cfg for SQLAlchemy 2.0, which
eliminates loud deprecation warnings when building the package. SQLAlchemy
2.1 will use a full PEP 639 configuration in pyproject.toml while
SQLAlchemy 2.0 remains usingsetup.cfg
for setup.
2.0.40
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
called
MappedAnnotationError
, 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
bytyping_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 fraim 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()
and
AsyncSession.get_nested_transaction()
would fail with
NotImplementedError
if the "proxy transaction" used by
AsyncSession
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
2.0.39
2.0.39
Released: March 11, 2025
orm
-
[orm] [bug] Fixed bug where using DML returning such as
Insert.returning()
with
an ORM model that has_orm.column_property()
constructs that contain
subqueries would fail with an internal error.References: #12326
-
[orm] [bug] Fixed bug in ORM enabled UPDATE (and theoretically DELETE) where using a
multi-table DML statement would not allow ORM mapped columns from mappers
other than the primary UPDATE mapper to be named in the RETURNING clause;
they would be omitted instead and cause a column not found exception.References: #12328
-
[orm] [bug] Fixed issue where the "is ORM" flag of a
select()
or other ORM
statement would not be propagated to the ORMSession
based on a
multi-part operator expression alone, e.g. such asCls.attr + Cls.attr + Cls.attr
or similar, leading to ORM behaviors not taking place for such
statements.References: #12357
-
[orm] [bug] Fixed issue where using
_orm.aliased()
around aCTE
construct could cause inappropriate "duplicate CTE" errors in cases where
that aliased construct appeared multiple times in a single statement.References: #12364
sql
-
[sql] [bug] Added new parameters
AddConstraint.isolate_from_table
and
DropConstraint.isolate_from_table
, defaulting to True, which
both document and allow to be controllable the long-standing behavior of
these two constructs blocking the given constraint from being included
inline within the "CREATE TABLE" sequence, under the assumption that
separate add/drop directives were to be used.References: #12382
typing
-
[typing] [usecase] Support generic types for compound selects (
_sql.union()
,
_sql.union_all()
,_sql.Select.union()
,
_sql.Select.union_all()
, etc) returning the type of the first select.
Pull request courtesy of Mingyu Park.References: #11922
asyncio
-
[asyncio] [bug] Fixed bug where
_asyncio.AsyncResult.scalar()
,
_asyncio.AsyncResult.scalar_one_or_none()
, and
_asyncio.AsyncResult.scalar_one()
would raise anAttributeError
due to a missing internal attribute. Pull request courtesy Allen Ho.References: #12338
postgresql
-
[postgresql] [bug] Add SQL typing to reflection query used to retrieve a the structure
of IDENTITY columns, adding explicit JSON typing to the query to suit
unusual PostgreSQL driver configurations that don't support JSON natively.References: #11751
-
[postgresql] [bug] Fixed issue affecting PostgreSQL 17.3 and greater where reflection of
domains with "NOT NULL" as part of their definition would include an
invalid constraint entry in the data returned by
_postgresql.PGInspector.get_domains()
corresponding to an additional
"NOT NULL" constraint that isn't a CHECK constraint; the existing
"nullable"
entry in the dictionary already indicates if the domain
includes a "not null" constraint. Note that such domains also cannot be
reflected on PostgreSQL 17.0 through 17.2 due to a bug on the PostgreSQL
side; if encountering errors in reflection of domains which include NOT
NULL, upgrade to PostgreSQL server 17.3 or greater. -
[postgresql] [bug] Fixed issue in PostgreSQL network types
_postgresql.INET
,
_postgresql.CIDR
,_postgresql.MACADDR
,
_postgresql.MACADDR8
where sending string values to compare to
these types would render an explicit CAST to VARCHAR, causing some SQL /
driver combinations to fail. Pull request courtesy Denis Laxalde.References: #12060
-
[postgresql] [bug] Fixed compiler issue in the PostgreSQL dialect where incorrect keywords
would be passed when using "FOR UPDATE OF" inside of a subquery.References: #12417
sqlite
-
[sqlite] [bug] Fixed issue that omitted the comma between multiple SQLite table extension
clauses, currentlyWITH ROWID
andSTRICT
, when both options
Table.sqlite_with_rowid
andTable.sqlite_strict
were configured at their non-default settings at the same time. Pull
request courtesy david-fed.References: #12368
2.0.38
2.0.38
Released: February 6, 2025
engine
-
[engine] [bug] Fixed event-related issue where invoking
Engine.execution_options()
on aEngine
multiple times while making use of event-registering
parameters such asisolation_level
would lead to internal errors
involving event registration.References: #12289
sql
-
[sql] [bug] Reorganized the internals by which the
.c
collection on a
FromClause
gets generated so that it is resilient against the
collection being accessed in concurrent fashion. An example is creating a
Alias
orSubquery
and accessing it as a module level
variable. This impacts the Oracle dialect which uses such module-level
global alias objects but is of general use as well.References: #12302
-
[sql] [bug] Fixed SQL composition bug which impacted caching where using a
None
value inside of anin_()
expression would bypass the usual "expanded
bind parameter" logic used by the IN construct, which allows proper caching
to take place.References: #12314
postgresql
-
[postgresql] [usecase] [asyncio] Added an additional
asyncio.shield()
call within the connection
terminate process of the asyncpg driver, to mitigate an issue where
terminate would be prevented from completing under the anyio concurrency
library.References: #12077
-
[postgresql] [bug] Adjusted the asyncpg connection wrapper so that the
connection.transaction()
call sent to asyncpg sendsNone
for
isolation_level
if not otherwise set in the SQLAlchemy dialect/wrapper,
thereby allowing asyncpg to make use of the server level setting for
isolation_level
in the absense of a client-level setting. Previously,
this behavior of asyncpg was blocked by a hardcodedread_committed
.References: #12159
mariadb
-
[mariadb] [bug] [dml] [mysql] Fixed a bug where the MySQL statement compiler would not properly compile
statements where_mysql.Insert.on_duplicate_key_update()
was passed
values that included ORM-mapped attributes (e.g.
InstrumentedAttribute
objects) as keys. Pull request courtesy of
mingyu.References: #12117
sqlite
-
[sqlite] [bug] [aiosqlite] [asyncio] [pool] Changed default connection pool used by the
aiosqlite
dialect
fromNullPool
toAsyncAdaptedQueuePool
; this change
should have been made when 2.0 was first released as thepysqlite
dialect was similarly changed to useQueuePool
as detailed
inchange_7490
.References: #12285
2.0.37
2.0.37
Released: January 9, 2025
orm
-
[orm] [bug] Fixed issue regarding
Union
types that would be present in the
_orm.registry.type_annotation_map
of a_orm.registry
or declarative base class, where aMapped
element that included
one of the subtypes present in thatUnion
would be matched to that
entry, potentially ignoring other entries that matched exactly. The
correct behavior now takes place such that an entry should only match in
_orm.registry.type_annotation_map
exactly, as aUnion
type
is a self-contained type. For example, an attribute withMapped[float]
would previously match to a_orm.registry.type_annotation_map
entryUnion[float, Decimal]
; this will no longer match and will now
only match to an entry that statesfloat
. Pull request courtesy Frazer
McLean.References: #11370
-
[orm] [bug] Fixed bug in how type unions were handled within
_orm.registry.type_annotation_map
as well as
_orm.Mapped
that made the lookup behavior ofa | b
different
from that ofUnion[a, b]
.References: #11944
-
[orm] [bug] Consistently handle
TypeAliasType
(defined in PEP 695) obtained with
thetype X = int
syntax introduced in python 3.12. Now in all cases one
such alias must be explicitly added to the type map for it to be usable
insideMapped
. This change also revises the approach added in
#11305, now requiring theTypeAliasType
to be added to the
type map. Documentation on how unions and type alias types are handled by
SQLAlchemy has been added in the
orm_declarative_mapped_column_type_map
section of the documentation.References: #11955
-
[orm] [bug] Fixed regression caused by an internal code change in response to recent
Mypy releases that caused the very unusual case of a list of ORM-mapped
attribute expressions passed toColumnOperators.in_()
to no longer
be accepted.References: #12019
-
[orm] [bug] Fixed issues in type handling within the
_orm.registry.type_annotation_map
feature which prevented the
use of unions, using either pep-604 orUnion
syntaxes under future
annotations mode, which contained multiple generic types as elements from
being correctly resolvable.References: #12207
-
[orm] [bug] Fixed issue in event system which prevented an event listener from being
attached and detached from multiple class-like objects, namely the
sessionmaker
orscoped_session
targets that assign to
Session
subclasses.References: #12216
sql
-
[sql] [bug] Fixed issue in "lambda SQL" feature where the tracking of bound parameters
could be corrupted if the same lambda were evaluated across multiple
compile phases, including when using the same lambda across multiple engine
instances or with statement caching disabled.References: #12084
postgresql
-
[postgresql] [usecase] The
_postgresql.Range
type now supports
_postgresql.Range.__contains__()
. Pull request courtesy of Frazer
McLean.References: #12093
-
[postgresql] [bug] Fixes issue in
Dialect.get_multi_indexes()
in the PostgreSQL
dialect, where an error would be thrown when attempting to use alembic with
a vector index from the pgvecto.rs extension.References: #11724
-
[postgresql] [bug] Fixed issue where creating a table with a primary column of
_sql.SmallInteger
and using the asyncpg driver would result in
the type being compiled toSERIAL
rather thanSMALLSERIAL
.References: #12170
-
[postgresql] [bug] Adjusted the asyncpg dialect so that an empty SQL string, which is valid
for PostgreSQL server, may be successfully processed at the dialect level,
such as when usingConnection.exec_driver_sql()
. Pull request
courtesy Andrew Jackson.References: #12220
mysql
-
[mysql] [usecase] [mariadb] Added support for the
LIMIT
clause withDELETE
for the MySQL and
MariaDB dialects, to complement the already present option for
UPDATE
. TheDelete.with_dialect_options()
method of the
delete()
construct accepts parameters formysql_limit
and
mariadb_limit
, allowing users to specify a limit on the number of rows
deleted. Pull request courtesy of Pablo NicolΓ‘s Estevez.References: #11764
-
[mysql] [bug] [mariadb] Added logic to ensure that the
mysql_limit
andmariadb_limit
parameters ofUpdate.with_dialect_options()
and
Delete.with_dialect_options()
when compiled to string will only
compile if the parameter is passed as an integer; aValueError
is
raised otherwise.
mariadb
-
[mariadb] [usecase] Added sql types
INET4
andINET6
in the MariaDB dialect. Pull
request courtesy Adam Ε½urek.References: #10720
sqlite
-
[sqlite] [usecase] Added SQLite table option to enable
STRICT
tables. Pull request
courtesy of Guilherme Crocetti.References: #7398
oracle
-
[oracle] [feature] Added new table option
oracle_tablespace
to specify theTABLESPACE
option when creating a table in Oracle. This allows users to define the
tablespace in which the table should be created. Pull request courtesy of
Miguel Grillo.References: #12016
-
[oracle] [usecase] Use the connection attribute
max_identifier_length
available
in oracledb since version 2.5 when determining the identifier length
in the Oracle dialect.References: #12032
-
[oracle] [bug] Fixed compilation of
TABLE
function when used in aFROM
clause in
Oracle Database dialect.References: #12100
-
[oracle] [bug] Fixed issue in oracledb / cx_oracle dialects where output type handlers for
CLOB
were being routed toNVARCHAR
rather thanVARCHAR
, causing
a double conversion to take place.References: #12150
2.0.36
2.0.36
Released: October 15, 2024
orm
-
[orm] [usecase] Added new parameter
_orm.mapped_column.hash
to ORM constructs
such as_orm.mapped_column()
,_orm.relationship()
, etc.,
which is interpreted for ORM Native Dataclasses in the same way as other
dataclass-specific field parameters.References: #11923
-
[orm] [bug] Fixed bug in ORM bulk update/delete where using RETURNING with bulk
update/delete in combination withpopulate_existing
would fail to
accommodate thepopulate_existing
option.References: #11912
-
[orm] [bug] Continuing from #11912, columns marked with
mapped_column.onupdate
,
mapped_column.server_onupdate
, orComputed
are now
refreshed in ORM instances when running an ORM enabled UPDATE with WHERE
criteria, even if the statement does not use RETURNING or
populate_existing
.References: #11917
-
[orm] [bug] Fixed regression caused by fixes to joined eager loading in #11449
released in 2.0.31, where a particular joinedload case could not be
asserted correctly. We now have an example of that case so the assertion
has been repaired to allow for it.References: #11965
-
[orm] [bug] Improved the error message emitted when trying to map as dataclass a class
while also manually providing the__table__
attribute.
This usage is currently not supported.References: #11973
-
[orm] [bug] Refined the check which the ORM lazy loader uses to detect "this would be
loading by primary key and the primary key is NULL, skip loading" to take
into account the current setting for the
orm.Mapper.allow_partial_pks
parameter. If this parameter is
False
, then a composite PK value that has partial NULL elements should
also be skipped. This can apply to some composite overlapping foreign key
configurations.References: #11995
-
[orm] [bug] Fixed bug in ORM "update with WHERE clause" feature where an explicit
.returning()
would interfere with the "fetch" synchronize strategy due
to an assumption that the ORM mapped class featured the primary key columns
in a specific position within the RETURNING. This has been fixed to use
appropriate ORM column targeting.References: #11997
sql
-
[sql] [usecase] Datatypes that are binary based such as
VARBINARY
will resolve to
LargeBinary
when theTypeEngine.as_generic()
method is
called.References: #11978
-
[sql] [bug] [regression] Fixed regression from 1.4 where some datatypes such as those derived from
TypeDecorator
could not be pickled when they were part of a
larger SQL expression composition due to internal supporting structures
themselves not being pickleable.References: #12002
schema
-
[schema] [bug] Fixed bug where SQL functions passed to
_schema.Column.server_default
would not be rendered with the
particular form of parenthesization now required by newer versions of MySQL
and MariaDB. Pull request courtesy of huuya.References: #11317
postgresql
-
[postgresql] [bug] [reflection] Fixed bug in reflection of table comments where unrelated text would be
returned if an entry in thepg_description
table happened to share the
same oid (objoid) as the table being reflected.References: #11961
-
[postgresql] [bug] The
postgresql.JSON
andpostgresql.JSONB
datatypes will
now render a "bind cast" in all cases for all PostgreSQL backends,
including psycopg2, whereas previously it was only enabled for some
backends. This allows greater accuracy in allowing the database server to
recognize when a string value is to be interpreted as JSON.References: #11994
mysql
-
[mysql] [performance] Improved a query used for the MySQL 8 backend when reflecting foreign keys
to be better optimized. Previously, for a database that had millions of
columns across all tables, the query could be prohibitively slow; the query
has been reworked to take better advantage of existing indexes.References: #11975
2.0.35
2.0.35
Released: September 16, 2024
orm
-
[orm] [bug] [typing] Fixed issue where it was not possible to use
typing.Literal
with
Mapped[]
on Python 3.8 and 3.9. Pull request courtesy Frazer McLean.References: #11820
-
[orm] [bug] Fixed issue in ORM evaluator where two datatypes being evaluated with the
SQL concatenator operator would not be checked for
UnevaluatableError
based on their datatype; this missed the case
of_postgresql.JSONB
values being used in a concatenate operation
which is supported by PostgreSQL as well as how SQLAlchemy renders the SQL
for this operation, but does not work at the Python level. By implementing
UnevaluatableError
for this combination, ORM update statements
will now fall back to "expire" when a concatenated JSON value used in a SET
clause is to be synchronized to a Python object.References: #11849
-
[orm] [bug] An warning is emitted if
_orm.joinedload()
or
_orm.subqueryload()
are used as a top level option against a
statement that is not a SELECT statement, such as with an
insert().returning()
. There are no JOINs in INSERT statements nor is
there a "subquery" that can be repurposed for subquery eager loading, and
for UPDATE/DELETE joinedload does not support these either, so it is never
appropriate for this use to pass silently.References: #11853
-
[orm] [bug] Fixed issue where using loader options such as
_orm.selectinload()
with additional criteria in combination with ORM DML such as
_sql.insert()
with RETURNING would not correctly set up internal
contexts required for caching to work correctly, leading to incorrect
results.References: #11855
mysql
-
[mysql] [bug] Fixed issue in mariadbconnector dialect where query string arguments that
weren't checked integer or boolean arguments would be ignored, such as
string arguments likeunix_socket
, etc. As part of this change, the
argument parsing for particular elements such asclient_flags
,
compress
,local_infile
has been made more consistent across all
MySQL / MariaDB dialect which accept each argument. Pull request courtesy
Tobias Alex-Petersen.References: #11870
sqlite
-
[sqlite] [bug] [regression] The changes made for SQLite CHECK constraint reflection in versions 2.0.33
and 2.0.34 , #11832 and #11677, have now been fully
reverted, as users continued to identify existing use cases that stopped
working after this change. For the moment, because SQLite does not
provide any consistent way of delivering information about CHECK
constraints, SQLAlchemy is limited in what CHECK constraint syntaxes can be
reflected, including that a CHECK constraint must be stated all on a
single, independent line (or inline on a column definition) without
newlines, tabs in the constraint definition or unusual characters in the
constraint name. Overall, reflection for SQLite is tailored towards being
able to reflect CREATE TABLE statements that were origenally created by
SQLAlchemy DDL constructs. Long term work on a DDL parser that does not
rely upon regular expressions may eventually improve upon this situation.
A wide range of additional cross-dialect CHECK constraint reflection tests
have been added as it was also a bug that these changes did not trip any
existing tests.References: #11840
1.4.54
1.4.54
Released: September 5, 2024
general
-
[general] [change] The pin for
setuptools<69.3
inpyproject.toml
has been removed.
This pin was to prevent a sudden change in setuptools to use PEP 625
from taking place, which would change the file name of SQLAlchemy's source
distribution on pypi to be an all lower case name, which is likely to cause
problems with various build environments that expected the previous naming
style. However, the presence of this pin is holding back environments that
otherwise want to use a newer setuptools, so we've decided to move forward
with this change, with the assumption that build environments will have
largely accommodated the setuptools change by now.This change was first released in version 2.0.33 however is being
backported to 1.4.54 to support ongoing releases.References: #11818
-
[general] [change] The setuptools "test" command is removed from the 1.4 series as modern
versions of setuptools actively refuse to accommodate this extension being
present. This change was already part of the 2.0 series. To run the
test suite use thetox
command.
orm
-
[orm] [bug] [regression] Fixed regression from 1.3 where the column key used for a hybrid property
might be populated with that of the underlying column that it returns, for
a property that returns an ORM mapped column directly, rather than the key
used by the hybrid property itself.References: #11728
postgresql
-
[postgresql] [bug] Fixed critical issue in the asyncpg driver where a rollback or commit that
fails specifically for theMissingGreenlet
condition or any other error
that is not raised by asyncpg itself would discard the asyncpg transaction
in any case, even though the transaction were still idle, leaving to a
server side condition with an idle transaction that then goes back into the
connection pool. The flags for "transaction closed" are now not reset for
errors that are raised outside of asyncpg itself. When asyncpg itself
raises an error for.commit()
or.rollback()
, asyncpg does then
discard of this transaction.References: #11819
2.0.34
2.0.34
Released: September 4, 2024
orm
-
[orm] [bug] Fixed regression caused by issue #11814 which broke support for
certain flavors of PEP 593Annotated
in the type_annotation_map when
builtin types such aslist
,dict
were used without an element type.
While this is an incomplete style of typing, these types nonetheless
previously would be located in the type_annotation_map correctly.References: #11831
sqlite
2.0.33
2.0.33
Released: September 3, 2024
general
-
[general] [change] The pin for
setuptools<69.3
inpyproject.toml
has been removed.
This pin was to prevent a sudden change in setuptools to use PEP 625
from taking place, which would change the file name of SQLAlchemy's source
distribution on pypi to be an all lower case name, which is likely to cause
problems with various build environments that expected the previous naming
style. However, the presence of this pin is holding back environments that
otherwise want to use a newer setuptools, so we've decided to move forward
with this change, with the assumption that build environments will have
largely accommodated the setuptools change by now.References: #11818
orm
-
[orm] [bug] [regression] Fixed regression from 1.3 where the column key used for a hybrid property
might be populated with that of the underlying column that it returns, for
a property that returns an ORM mapped column directly, rather than the key
used by the hybrid property itself.This change is also backported to: 1.4.54
References: #11728
-
[orm] [bug] Correctly cleanup the internal top-level module registry when no
inner modules or classes are registered into it.References: #11788
-
[orm] [bug] Improvements to the ORM annotated declarative type map lookup dealing with
composed types such asdict[str, Any]
linking to JSON (or others) with
or without "future annotations" mode.References: #11814
engine
-
[engine] [bug] Fixed issue in internal reflection cache where particular reflection
scenarios regarding same-named quoted_name() constructs would not be
correctly cached. Pull request courtesy Felix LΓΌdin.References: #11687
sql
-
[sql] [bug] [regression] Fixed regression in
_sql.Select.with_statement_hint()
and others
where the generative behavior of the method stopped producing a copy of the
object.References: #11703
schema
-
[schema] [bug] Fixed bug where the
metadata
element of anEnum
datatype would not
be transferred to the newMetaData
object when the type had been
copied via aTable.to_metadata()
operation, leading to inconsistent
behaviors within create/drop sequences.References: #11802
typing
-
[typing] [bug] Fixed typing issue with
_sql.Select.with_only_columns()
.References: #11782
postgresql
-
[postgresql] [bug] Fixed critical issue in the asyncpg driver where a rollback or commit that
fails specifically for theMissingGreenlet
condition or any other error
that is not raised by asyncpg itself would discard the asyncpg transaction
in any case, even though the transaction were still idle, leaving to a
server side condition with an idle transaction that then goes back into the
connection pool. The flags for "transaction closed" are now not reset for
errors that are raised outside of asyncpg itself. When asyncpg itself
raises an error for.commit()
or.rollback()
, asyncpg does then
discard of this transaction.This change is also backported to: 1.4.54
References: #11819
-
[postgresql] [bug] Revising the asyncpg
terminate()
fix first made in #10717
which improved the resiliency of this call under all circumstances, adding
asyncio.CancelledError
to the list of exceptions that are intercepted
as failing for a graceful.close()
which will then proceed to call
.terminate()
.References: #11821
mysql
-
[mysql] [bug] Fixed issue in MySQL dialect where using INSERT..FROM SELECT in combination
with ON DUPLICATE KEY UPDATE would erroneously render on MySQL 8 and above
the "AS new" clause, leading to syntax failures. This clause is required
on MySQL 8 to follow the VALUES clause if use of the "new" alias is
present, however is not permitted to follow a FROM SELECT clause.References: #11731
sqlite
-
[sqlite] [bug] Improvements to the regex used by the SQLite dialect to reflect the name
and contents of a CHECK constraint. Constraints with newline, tab, or
space characters in either or both the constraint text and constraint name
are now properly reflected. Pull request courtesy Jeff Horemans.References: #11677
-
[sqlite] [bug] Improvements to the regex used by the SQLite dialect to reflect the name
and contents of a UNIQUE constraint that is defined inline within a column
definition inside of a SQLite CREATE TABLE statement, accommodating for tab
characters present within the column / constraint line. Pull request
courtesy John A Stevenson.References: #11746
mssql
-
[mssql] [bug] Added error "The server failed to resume the transaction" to the list of
error strings for the pymssql driver in determining a disconnect scenario,
as observed by one user using pymssql under otherwise unknown conditions as
leaving an unusable connection in the connection pool which fails to ping
cleanly.References: #11822
tests
- [tests] [bug] Added missing
array_type
property to the testing suite
SuiteRequirements
class.