summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2021-05-09 02:59:21 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-05-09 02:59:21 +0000
commit4b8368537e098e072e0c8581e2c15fa4df25c152 (patch)
tree741c0dae3b9cfcfe8e290baa04c8e5a419088050 /lib/sqlalchemy
parentf8b3a6a6e8a51bcb697ffd9aa79ad6ee706e1d24 (diff)
parent7e938c1bc13f894355dafd4abca3566a759b79ad (diff)
downloadsqlalchemy-4b8368537e098e072e0c8581e2c15fa4df25c152.tar.gz
Merge "Ensure propagate_to_loaders honored at the sub-loader level"
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/strategy_options.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py
index 8602f37b6..f61cf835d 100644
--- a/lib/sqlalchemy/orm/strategy_options.py
+++ b/lib/sqlalchemy/orm/strategy_options.py
@@ -185,9 +185,12 @@ class Load(Generative, LoaderOption):
self._process(compile_state, not bool(compile_state.current_path))
def _process(self, compile_state, raiseerr):
+ is_refresh = compile_state.compile_options._for_refresh_state
current_path = compile_state.current_path
if current_path:
for (token, start_path), loader in self.context.items():
+ if is_refresh and not loader.propagate_to_loaders:
+ continue
chopped_start_path = self._chop_path(start_path, current_path)
if chopped_start_path is not None:
compile_state.attributes[
@@ -705,9 +708,12 @@ class _UnboundLoad(Load):
def _process(self, compile_state, raiseerr):
dedupes = compile_state.attributes["_unbound_load_dedupes"]
+ is_refresh = compile_state.compile_options._for_refresh_state
for val in self._to_bind:
if val not in dedupes:
dedupes.add(val)
+ if is_refresh and not val.propagate_to_loaders:
+ continue
val._bind_loader(
[
ent.entity_zero