Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 85635e9

Browse files
committed
df: memory: Silence forwarding if not appliacble
Signed-off-by: John Andersen <[email protected]>
1 parent 883070b commit 85635e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dffml/df/memory.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ async def receive_from_parent_flow(self, inputs: List[Input]):
260260
"""
261261
Takes input from parent dataflow and adds it to every active context
262262
"""
263+
if not inputs:
264+
return
263265
async with self.ctxhd_lock:
264266
ctx_keys = list(self.ctxhd.keys())
265267
self.logger.debug(f"Receiving {inputs} from parent flow")
@@ -1273,10 +1275,14 @@ async def seed_inputs(
12731275
return ctx
12741276

12751277
async def forward_inputs_to_subflow(self, inputs: List[Input]):
1278+
if not inputs:
1279+
return
12761280
# Go through input set,find instance_names of registered subflows which
12771281
# have definition of the current input listed in `forward`.
12781282
# If found,add `input` to list of inputs to forward for that instance_name
12791283
forward = self.config.dataflow.forward
1284+
if not forward.book:
1285+
return
12801286
inputs_to_forward = {}
12811287
for item in inputs:
12821288
instance_list = forward.get_instances_to_forward(item.definition)

0 commit comments

Comments
 (0)