summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/decl_base.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/decl_base.py b/lib/sqlalchemy/orm/decl_base.py
index a858f12cb..9f4930243 100644
--- a/lib/sqlalchemy/orm/decl_base.py
+++ b/lib/sqlalchemy/orm/decl_base.py
@@ -1060,6 +1060,17 @@ class _ClassScanMapperConfig(_MapperConfig):
attr_value,
originating_module,
) in self.collected_annotations.items()
+ if key not in self.collected_attributes
+ # issue #9226; check for attributes that we've collected
+ # which are already instrumented, which we would assume
+ # mean we are in an ORM inheritance mapping and this attribute
+ # is already mapped on the superclass. Under no circumstance
+ # should any QueryableAttribute be sent to the dataclass()
+ # function; anything that's mapped should be Field and
+ # that's it
+ or not isinstance(
+ self.collected_attributes[key], QueryableAttribute
+ )
)
]
annotations = {}