summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/coercions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-05-29 10:05:20 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-05-29 10:10:14 -0400
commit9727cdecbe52b86b4328b92d7e10a7193ca8083e (patch)
tree51cf0647c398720e3e0eb46869b71b463bb36fb7 /lib/sqlalchemy/sql/coercions.py
parent3edc30fce3717b48407f37de958f5b6e6d0bc549 (diff)
downloadsqlalchemy-9727cdecbe52b86b4328b92d7e10a7193ca8083e.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/sql/coercions.py')
-rw-r--r--lib/sqlalchemy/sql/coercions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py
index 82068d768..ea2289a9d 100644
--- a/lib/sqlalchemy/sql/coercions.py
+++ b/lib/sqlalchemy/sql/coercions.py
@@ -884,6 +884,9 @@ class JoinTargetImpl(RoleImpl):
self, original_element, resolved, argname=None, legacy=False, **kw
):
if isinstance(original_element, roles.JoinTargetRole):
+ # note that this codepath no longer occurs as of
+ # #6550, unless JoinTargetImpl._skip_clauseelement_for_target_match
+ # were set to False.
return original_element
elif legacy and isinstance(resolved, str):
util.warn_deprecated_20(