]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
warn for no polymorphic identity w/ poly hierarchy
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Oct 2022 18:03:04 +0000 (14:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 11 Oct 2022 14:46:38 +0000 (10:46 -0400)
commit855472e963bcebe426f1fb89e1b82947e4f5208f
tree6776ef0d4e8848b39c37b5f5f26ca4915a423312
parenta84f474051cae710e33b3d9486194ed534fe0167
warn for no polymorphic identity w/ poly hierarchy

A warning is emitted when attempting to configure a mapped class within an
inheritance hierarchy where the mapper is not given any polymorphic
identity, however there is a polymorphic discriminator column assigned.
Such classes should be abstract if they never intend to load directly.

Fixes: #7545
Change-Id: I94f04e59736c73e3f39d883a75d763e3f06ecc3d
(cherry picked from commit bf0634131115a76aaca52eebd3c7d3fb52f8258b)
doc/build/changelog/unreleased_14/7545.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
test/orm/declarative/test_inheritance.py
test/orm/inheritance/test_basic.py
test/orm/test_events.py