From: Mike Bayer Date: Sat, 16 Apr 2022 15:40:13 +0000 (-0400) Subject: adapt_from_selectables is a set X-Git-Tag: rel_2_0_0b1~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c538f810bce57472c8960a0a6c4c61024b00f3ed;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git adapt_from_selectables is a set aliasedclass setting this as a list, making all the containment checks more expensive. the presence of the collection also serves as a flag so it has to stay optional. Change-Id: Iafffbeb29d77441ca35ecd8048244ee6eed1232c --- diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index 233085f305..4699781a42 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -744,11 +744,11 @@ class AliasedInsp( # make sure the adapter doesn't try to grab other tables that # are not even the thing we are mapping, such as embedded # selectables in subqueries or CTEs. See issue #6060 - adapt_from_selectables=[ + adapt_from_selectables={ m.selectable for m in self.with_polymorphic_mappers if not adapt_on_names - ], + }, ) if nest_adapters: