From 1fa3e2e3814b4d28deca7426bb3f36e7fb515496 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 28 Apr 2022 16:19:43 -0400 Subject: pep484: attributes and related also implements __slots__ for QueryableAttribute, InstrumentedAttribute, Relationship.Comparator. Change-Id: I47e823160706fc35a616f1179a06c7864089e5b5 --- lib/sqlalchemy/sql/util.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/util.py') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 2e0112f08..2655adbdc 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -1265,7 +1265,16 @@ class ColumnAdapter(ClauseAdapter): if self.adapt_required and c is col: return None - c._allow_label_resolve = self.allow_label_resolve + # allow_label_resolve is consumed by one case for joined eager loading + # as part of its logic to prevent its own columns from being affected + # by .order_by(). Before full typing were applied to the ORM, this + # logic would set this attribute on the incoming object (which is + # typically a column, but we have a test for it being a non-column + # object) if no column were found. While this seemed to + # have no negative effects, this adjustment should only occur on the + # new column which is assumed to be local to an adapted selectable. + if c is not col: + c._allow_label_resolve = self.allow_label_resolve return c -- cgit v1.2.1