rel_2_0_5_post1
版本发布时间: 2023-03-06 11:49:36
sqlalchemy/sqlalchemy最新发布版本:rel_2_0_29(2024-03-24 05:53:32)
2.0.5.post1
Released: March 5, 2023
orm
-
[orm] [bug] Added constructor arguments to the built-in mapping collection types including
KeyFuncDict
,_orm.attribute_keyed_dict()
,_orm.column_keyed_dict()
so that these dictionary types may be constructed in place given the data up front; this provides further compatibility with tools such as Python dataclasses.asdict()
which relies upon invoking these classes directly as ordinary dictionary classes.References: #9418
-
[orm] [bug] [regression] Fixed multiple regressions due to #8372, involving
_orm.attribute_mapped_collection()
(now called_orm.attribute_keyed_dict()
).First, the collection was no longer usable with "key" attributes that were not themselves ordinary mapped attributes; attributes linked to descriptors and/or association proxy attributes have been fixed.
Second, if an event or other operation needed access to the "key" in order to populate the dictionary from an mapped attribute that was not loaded, this also would raise an error inappropriately, rather than trying to load the attribute as was the behavior in 1.4. This is also fixed.
For both cases, the behavior of #8372 has been expanded. #8372 introduced an error that raises when the derived key that would be used as a mapped dictionary key is effectively unassigned. In this change, a warning only is emitted if the effective value of the ".key" attribute is
None
, where it cannot be unambiguously determined if thisNone
was intentional or not.None
will be not supported as mapped collection dictionary keys going forward (as it typically refers to NULL which means "unknown"). Setting_orm.attribute_keyed_dict.ignore_unpopulated_attribute
will now cause suchNone
keys to be ignored as well.References: #9424
-
[orm] [bug] Identified that the
sqlite
andmssql+pyodbc
dialects are now compatible with the SQLAlchemy ORM's "versioned rows" feature, since SQLAlchemy now computes rowcount for a RETURNING statement in this specific case by counting the rows returned, rather than relying uponcursor.rowcount
. In particular, the ORM versioned rows use case (documented atmapper_version_counter
) should now be fully supported with the SQL Server pyodbc dialect. -
[orm] [bug] Added support for the
_orm.Mapper.polymorphic_load
parameter to be applied to each mapper in an inheritance hierarchy more than one level deep, allowing columns to load for all classes in the hierarchy that indicate"selectin"
using a single statement, rather than ignoring elements on those intermediary classes that nonetheless indicate they also would participate in"selectin"
loading and were not part of the base-most SELECT statement.References: #9373
-
[orm] [bug] Continued the fix for #8853, allowing the
_orm.Mapped
name to be fully qualified regardless of whether or notfrom __annotations__ import future
were present. This issue first fixed in 2.0.0b3 confirmed that this case worked via the test suite, however the test suite apparently was not testing the behavior for the name_orm.Mapped
not being locally present at all; string resolution has been updated to ensure the_orm.Mapped
symbol is locatable as applies to how the ORM uses these functions.
orm declarative
-
[bug] [orm declarative] Fixed issue where new
_orm.mapped_column.use_existing_column
feature would not work if the two same-named columns were mapped under attribute names that were differently-named from an explicit name given to the column itself. The attribute names can now be differently named when using this parameter.References: #9332
engine
-
[engine] [performance] A small optimization to the Cython implementation of
Result
using a cdef for a particular int value to avoid Python overhead. Pull request courtesy Matus Valo.References: #9343
-
[engine] [bug] Fixed bug where
_engine.Row
objects could not be reliably unpickled across processes due to an accidental reliance on an unstable hash value.References: #9423
sql
-
[sql] [bug] [regression] Restore the
nullslast()
andnullsfirst()
legacy functions into thesqlalchemy
import namespace. Previously, the newernulls_last()
andnulls_first()
functions were available, but the legacy ones were inadvertently removed.References: #9390
schema
-
[schema] Validate that when provided the
_schema.MetaData.schema
argument of_schema.MetaData
is a string.
typing
-
[typing] [usecase] Exported the type returned by
_orm.scoped_session.query_property()
using a new public typeorm.QueryPropertyDescriptor
.References: #9338
-
[typing] [bug] Fixed bug where the
_engine.Connection.scalars()
method was not typed as allowing a multiple-parameters list, which is now supported using insertmanyvalues operations. -
[typing] [bug] Improved typing for the mapping passed to
Insert.values()
andUpdate.values()
to be more open-ended about collection type, by indicating read-onlyMapping
instead of writeableDict
which would error out on too limited of a key type.References: #9376
-
[typing] [bug] Added missing init overload to the
_types.Numeric
type object so that pep-484 type checkers may properly resolve the complete type, deriving from the_types.Numeric.asdecimal
parameter whetherDecimal
orfloat
objects will be represented.References: #9391
-
[typing] [bug] Fixed typing bug where
_sql.Select.from_statement()
would not accept_sql.text()
orTextualSelect
objects as a valid type. Additionally repaired theTextClause.columns
method to have a return type, which was missing.References: #9398
-
[typing] [bug] Fixed typing issue where
_orm.with_polymorphic()
would not record the class type correctly.References: #9340
postgresql
-
[postgresql] [bug] Fixed issue in PostgreSQL
_postgresql.ExcludeConstraint
where literal values were being compiled as bound parameters and not direct inline values as is required for DDL.References: #9349
-
[postgresql] [bug] Fixed issue where the PostgreSQL
_postgresql.ExcludeConstraint
construct would not be copyable within operations such as_schema.Table.to_metadata()
as well as within some Alembic scenarios, if the constraint contained textual expression elements.References: #9401
mysql
-
[mysql] [bug] [postgresql] The support for pool ping listeners to receive exception events via the
DialectEvents.handle_error()
event added in 2.0.0b1 for #5648 failed to take into account dialect-specific ping routines such as that of MySQL and PostgreSQL. The dialect feature has been reworked so that all dialects participate within event handling. Additionally, a new boolean elementExceptionContext.is_pre_ping
is added which identifies if this operation is occurring within the pre-ping operation.For this release, third party dialects which implement a custom
_engine.Dialect.do_ping()
method can opt in to the newly improved behavior by having their method no longer catch exceptions or check exceptions for "is_disconnect", instead just propagating all exceptions outwards. Checking the exception for "is_disconnect" is now done by an enclosing method on the default dialect, which ensures that the event hook is invoked for all exception scenarios before testing the exception as a "disconnect" exception. If an existingdo_ping()
method continues to catch exceptions and check "is_disconnect", it will continue to work as it did previously, buthandle_error
hooks will not have access to the exception if it isn't propagated outwards.References: #5648
sqlite
-
[sqlite] [bug] [regression] Fixed regression for SQLite connections where use of the
deterministic
parameter when establishing database functions would fail for older SQLite versions, those prior to version 3.8.3. The version checking logic has been improved to accommodate for this case.References: #9379
mssql
-
[mssql] [bug] Fixed issue in the new
Uuid
datatype which prevented it from working with the pymssql driver. As pymssql seems to be maintained again, restored testing support for pymssql.References: #9414
-
[mssql] [bug] Tweaked the pymssql dialect to take better advantage of RETURNING for INSERT statements in order to retrieve last inserted primary key values, in the same way as occurs for the mssql+pyodbc dialect right now.
misc
-
[bug] [ext] Fixed issue in automap where calling
_automap.AutomapBase.prepare()
from a specific mapped class, rather than from the_automap.AutomapBase
directly, would not use the correct base class when automap detected new tables, instead using the given class, leading to mappers trying to configure inheritance. While one should normally call_automap.AutomapBase.prepare()
from the base in any case, it shouldn't misbehave that badly when called from a subclass.References: #9367
-
[bug] [ext] [regression] Fixed regression caused by typing added to
sqlalchemy.ext.mutable
for #8667, where the semantics of the.pop()
method changed such that the method was non-working. Pull request courtesy Nils Philippsen.References: #9380
1、 SQLAlchemy-2.0.5.post1-cp310-cp310-macosx_10_9_x86_64.whl 1.87MB
2、 SQLAlchemy-2.0.5.post1-cp310-cp310-macosx_11_0_arm64.whl 1.86MB
3、 SQLAlchemy-2.0.5.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.59MB
4、 SQLAlchemy-2.0.5.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.59MB
5、 SQLAlchemy-2.0.5.post1-cp310-cp310-musllinux_1_1_aarch64.whl 2.61MB
6、 SQLAlchemy-2.0.5.post1-cp310-cp310-musllinux_1_1_x86_64.whl 2.61MB
7、 SQLAlchemy-2.0.5.post1-cp310-cp310-win32.whl 1.85MB
8、 SQLAlchemy-2.0.5.post1-cp310-cp310-win_amd64.whl 1.86MB
9、 SQLAlchemy-2.0.5.post1-cp311-cp311-macosx_10_9_x86_64.whl 1.87MB
10、 SQLAlchemy-2.0.5.post1-cp311-cp311-macosx_11_0_arm64.whl 1.86MB
11、 SQLAlchemy-2.0.5.post1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.64MB
12、 SQLAlchemy-2.0.5.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.64MB
13、 SQLAlchemy-2.0.5.post1-cp311-cp311-musllinux_1_1_aarch64.whl 2.64MB
14、 SQLAlchemy-2.0.5.post1-cp311-cp311-musllinux_1_1_x86_64.whl 2.64MB
15、 SQLAlchemy-2.0.5.post1-cp311-cp311-win32.whl 1.85MB
16、 SQLAlchemy-2.0.5.post1-cp311-cp311-win_amd64.whl 1.86MB
17、 SQLAlchemy-2.0.5.post1-cp37-cp37m-macosx_10_9_x86_64.whl 1.87MB
18、 SQLAlchemy-2.0.5.post1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.55MB
19、 SQLAlchemy-2.0.5.post1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.55MB
20、 SQLAlchemy-2.0.5.post1-cp37-cp37m-musllinux_1_1_aarch64.whl 2.57MB
21、 SQLAlchemy-2.0.5.post1-cp37-cp37m-musllinux_1_1_x86_64.whl 2.56MB
22、 SQLAlchemy-2.0.5.post1-cp37-cp37m-win32.whl 1.85MB
23、 SQLAlchemy-2.0.5.post1-cp37-cp37m-win_amd64.whl 1.87MB
24、 SQLAlchemy-2.0.5.post1-cp38-cp38-macosx_10_9_x86_64.whl 1.87MB
25、 SQLAlchemy-2.0.5.post1-cp38-cp38-macosx_11_0_arm64.whl 1.86MB
26、 SQLAlchemy-2.0.5.post1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.65MB
27、 SQLAlchemy-2.0.5.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.65MB
28、 SQLAlchemy-2.0.5.post1-cp38-cp38-musllinux_1_1_aarch64.whl 2.7MB
29、 SQLAlchemy-2.0.5.post1-cp38-cp38-musllinux_1_1_x86_64.whl 2.69MB
30、 SQLAlchemy-2.0.5.post1-cp38-cp38-win32.whl 1.85MB
31、 SQLAlchemy-2.0.5.post1-cp38-cp38-win_amd64.whl 1.87MB
32、 SQLAlchemy-2.0.5.post1-cp39-cp39-macosx_10_9_x86_64.whl 1.87MB
33、 SQLAlchemy-2.0.5.post1-cp39-cp39-macosx_11_0_arm64.whl 1.86MB
34、 SQLAlchemy-2.0.5.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.64MB
35、 SQLAlchemy-2.0.5.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.63MB
36、 SQLAlchemy-2.0.5.post1-cp39-cp39-musllinux_1_1_aarch64.whl 2.65MB
37、 SQLAlchemy-2.0.5.post1-cp39-cp39-musllinux_1_1_x86_64.whl 2.65MB
38、 SQLAlchemy-2.0.5.post1-cp39-cp39-win32.whl 1.85MB
39、 SQLAlchemy-2.0.5.post1-cp39-cp39-win_amd64.whl 1.87MB
40、 SQLAlchemy-2.0.5.post1-py3-none-any.whl 1.72MB