]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
upgrade deferred loader to regular loader if refresh_state
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Nov 2021 16:31:23 +0000 (11:31 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Nov 2021 18:58:21 +0000 (13:58 -0500)
commit9ecae501de3246ba98a0047ed2422c0ec08f2746
tree1401ec66c8b3c468a1458f4743c980f25308cd70
parent9ee47d90d804dc815685d42913ad170e04c38659
upgrade deferred loader to regular loader if refresh_state

Fixed issue where deferred polymorphic loading of attributes from a
joined-table inheritance subclass would fail to populate the attribute
correctly if the :func:`_orm.load_only` option were used to originally
exclude that attribute, in the case where the load_only were descending
from a relationship loader option.  The fix allows that other valid options
such as ``defer(..., raiseload=True)`` etc. still function as expected.

Fixes: #7304
Change-Id: I58b7ce7c450bcc52d2f0c9bfbcb4d747463ee9b2
(cherry picked from commit 52b3d6649525929ee1ec14487a2f007194ed741d)
doc/build/changelog/unreleased_14/7304.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
test/orm/inheritance/test_poly_loading.py