]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure propagate_attrs available on PropComparator
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 29 May 2021 14:05:20 +0000 (10:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 29 May 2021 14:10:14 +0000 (10:10 -0400)
commit9727cdecbe52b86b4328b92d7e10a7193ca8083e
tree51cf0647c398720e3e0eb46869b71b463bb36fb7
parent3edc30fce3717b48407f37de958f5b6e6d0bc549
Ensure propagate_attrs available on PropComparator

Fixed regression caused by just-released performance fix mentioned in #6550
where a query.join() to a relationship could produce an AttributeError if
the query were made against non-ORM structures only, a fairly unusual
calling pattern.

In this fix, since we are no longer going through the production
of ``__clause_element__()`` for Cls.some_relationship, I assumed we
just throw this object away completely but I missed the one little
bit where we might be getting ``_propagate_attrs`` from it.
So we implement ``_propagate_attrs`` on ``PropComparator`` as well,
since this is easy to define.

Fixes: #6558
Change-Id: If781bf844e7e3d3b0841aff1c3668e9d6af9f097
doc/build/changelog/unreleased_14/6558.rst [new file with mode: 0644]
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/sql/coercions.py
test/orm/test_bind.py
test/orm/test_joins.py