]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Filter attributes we don't map during a load_scalar_attributes
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 28 Oct 2017 17:28:58 +0000 (13:28 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 28 Oct 2017 17:30:18 +0000 (13:30 -0400)
commite06bf169e5fdac56e074592a4e154cef022bf757
tree69cfaafd1f596edb4bc160ef58b45df931894629
parent45a3cb6dd2857b96d6b5187a71d995d9a390d448
Filter attributes we don't map during a load_scalar_attributes

Fixed bug where a descriptor that is elsewhere a mapped column
or relationship within a hierarchy based on :class:`.AbstractConcreteBase`
would be referred towards during a refresh operation, causing an error
as the attribute is not mapped as a mapper property.
A similar issue can arise for other attributes like the "type" column
added by :class:`.AbstractConcreteBase` if the class fails to include
"concrete=True" in its mapper, however the check here should also
prevent that scenario from causing a problem.

Change-Id: I407b07a3a3e2c374da19fc86ed44b987d595dcfa
Fixes: #4124
(cherry picked from commit fd4289c5829d6498495ac59fe1dccb23b4975281)
doc/build/changelog/unreleased_11/4124.rst [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
test/ext/declarative/test_inheritance.py