]> 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:42:17 +0000 (11:42 -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
(cherry picked from commit c538f810bce57472c8960a0a6c4c61024b00f3ed)

lib/sqlalchemy/orm/util.py

index 9ec2ad0768f6e872fe96ddd9232ea75dc60f4b7e..50ac8917d3d4b51bb0022ddea3733cbd58ec0321 100644 (file)
@@ -708,11 +708,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: