]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
implement join_depth for immediateload, fix expunged loading
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 25 Jul 2023 15:26:03 +0000 (11:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Jul 2023 17:53:30 +0000 (13:53 -0400)
commit9f9ad6c0c9d71330c16dc9bcc74a84eba024e00d
tree79986b699a1469557bed4a9b3999ee65d5cd6029
parent9fc027b182483ce465c476757b2fd469bb54ae46
implement join_depth for immediateload, fix expunged loading

Fixed issue where the ``lazy="immediateload"`` loader strategy would place
an internal loading token into the ORM mapped attribute under circumstances
where the load should not occur, such as in a recursive self-referential
load.   As part of this change, the ``lazy="immediateload"`` strategy now
honors the :paramref:`_orm.relationship.join_depth` parameter for
self-referential eager loads in the same way as that of other eager
loaders, where leaving it unset or set at zero will lead to a
self-referential immediateload not occurring, setting it to a value of one
or greater will immediateload up until that given depth.

Fixes: #10139
Change-Id: I319d8cd86d7dd57f8ba61a9d483dc84505e02c72
doc/build/changelog/unreleased_20/10139.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
test/orm/_fixtures.py
test/orm/test_immediate_load.py