Skip to content

Commit

Permalink
Added if statement to fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrl committed May 8, 2023
1 parent 2d08e51 commit 417579e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions haystack/nodes/other/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def run( # type: ignore
) -> Tuple[Dict, str]:
if inputs:
results = self.run_accumulated(inputs, top_k_join=top_k_join)
results[0]["root_node"] = inputs[0]["root_node"]
if "root_node" in inputs[0]:
results[0]["root_node"] = inputs[0]["root_node"]
return results
warnings.warn("You are using a JoinNode with only one input. This is usually equivalent to a no-op.")
return self.run_accumulated(
Expand Down Expand Up @@ -58,7 +59,8 @@ def run_batch( # type: ignore
) -> Tuple[Dict, str]:
if inputs:
results = self.run_batch_accumulated(inputs=inputs, top_k_join=top_k_join)
results[0]["root_node"] = inputs[0]["root_node"]
if "root_node" in inputs[0]:
results[0]["root_node"] = inputs[0]["root_node"]
return results
warnings.warn("You are using a JoinNode with only one input. This is usually equivalent to a no-op.")
return self.run_batch_accumulated(
Expand Down

0 comments on commit 417579e

Please sign in to comment.