]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
have automap suppress overlaps warning for mapped secondary
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 25 Jun 2021 20:51:50 +0000 (16:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 25 Jun 2021 20:53:01 +0000 (16:53 -0400)
commit65e16e9b3e9ceabfbf3f11fbefa498109d8b335a
tree66211cf6d11ce2f84ac982871d0bdb53f003b656
parent791f1d9407f68cc668c7078fa87784ebdf3bd688
have automap suppress overlaps warning for mapped secondary

Fixed regression in :mod:`sqlalchemy.ext.automap` extension such that the
use case of creating an explicit mapped class to a table that is also the
:paramref:`_orm.relationship.secondary` element of a
:func:`_orm.relationship` that automap will be generating would emit the
"overlaps" warnings introduced in 1.4 and discussed at :ref:`error_qzyx`.
While generating this case from automap is still subject to the same
caveats that the "overlaps" warning refers towards, as automap is intended
for more ad-hoc use cases, the condition which produces the warning is
disabled when a many-to-many relationship with this particular pattern is
generated.

Fixes: #6679
Change-Id: Ib3a53982b076ed4999b0d3235f84008b9e2f1cce
doc/build/changelog/unreleased_14/6679.rst [new file with mode: 0644]
lib/sqlalchemy/ext/automap.py
lib/sqlalchemy/orm/relationships.py
test/ext/test_automap.py