summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-01-27 18:15:04 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-01-27 22:02:36 -0500
commit31236f657f5febad85291f2a3344e3cf7af8501c (patch)
tree8426d0abcb854c10f48c14e23c8dea96353dfaa8 /lib/sqlalchemy/orm/mapper.py
parent6779fa861d11668f67d780d77e4ae76965cee6f7 (diff)
downloadsqlalchemy-31236f657f5febad85291f2a3344e3cf7af8501c.tar.gz
fix regression based on mis-match of set/frozenset
Fixed regression where ORM models that used joined table inheritance with a composite foreign key would encounter an internal error in the mapper internals. Fixes: #9164 Change-Id: I8fdcdf6d72f3304bee191498d5554555b0ab7855
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
-rw-r--r--lib/sqlalchemy/orm/mapper.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index dd3aef8d6..a3b209e4a 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -3920,12 +3920,16 @@ class Mapper(
],
] = util.defaultdict(list)
+ def set_union(x, y):
+ return x.union(y)
+
for table in self._sorted_tables:
cols = set(table.c)
+
for m in self.iterate_to_root():
if m._inherits_equated_pairs and cols.intersection(
reduce(
- set.union, # type: ignore
+ set_union,
[l.proxy_set for l, r in m._inherits_equated_pairs],
)
):