]> 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:57:18 +0000 (13:57 -0500)
commit52b3d6649525929ee1ec14487a2f007194ed741d
tree66d24d06b9362051064a41ac38fe18d5a8ce0607
parentcf404d840c15fe167518dd884b295dc99ee26178
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
doc/build/changelog/unreleased_14/7304.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
test/orm/inheritance/test_poly_loading.py