]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
adapt_from_selectables is a set
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Apr 2022 15:40:13 +0000 (11:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Apr 2022 15:41:48 +0000 (11:41 -0400)
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

lib/sqlalchemy/orm/util.py

index 233085f305b0a7352ac6d506f803119aab188085..4699781a42bfd90d56e75a25c11fd0829b7e5f9b 100644 (file)
@@ -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: