]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
return empty MappedColumn() at early pep-593 step
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 May 2023 02:03:18 +0000 (22:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 May 2023 02:05:45 +0000 (22:05 -0400)
commit73a273c90cda2369ec071435edd9c6dc5c1d31c4
tree27a79e1c0800fffb6a1bce70830b779c0de16251
parente00591ec27f63d9cc851bbb3cf4824bd5644a8b8
return empty MappedColumn() at early pep-593 step

Fixed issue in new ORM Annotated Declarative where using a
:class:`_schema.ForeignKey` (or other column-level constraint) inside of
:func:`_orm.mapped_column` which is then copied out to models via pep-593
``Annotated`` would apply duplicates of each constraint to the
:class:`_schema.Column` as produced in the target :class:`_schema.Table`,
leading to incorrect CREATE TABLE DDL as well as migration directives under
Alembic.

Fixes: #9766
Change-Id: I8a3b2716bf393d1d2b5894f9f72b45fa59df1e08
doc/build/changelog/unreleased_20/9766.rst [new file with mode: 0644]
lib/sqlalchemy/orm/properties.py
test/orm/declarative/test_tm_future_annotations_sync.py
test/orm/declarative/test_typed_mapping.py