From ca68601ec7ddeee7004d72a9def8a65b1e4749f5 Mon Sep 17 00:00:00 2001 From: yuanwu2017 Date: Wed, 17 May 2023 14:48:11 +0800 Subject: [PATCH] fix: shaper exception when retriever return 0 docs. (#4929) * When retriever retrieves 0 documents from the documentStore, shaper will raise an exception. Signed-off-by: root Co-authored-by: root --- haystack/nodes/other/shaper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haystack/nodes/other/shaper.py b/haystack/nodes/other/shaper.py index 26ae6162b..a229234c6 100644 --- a/haystack/nodes/other/shaper.py +++ b/haystack/nodes/other/shaper.py @@ -740,7 +740,7 @@ class Shaper(BaseComponent): if labels and "labels" not in invocation_context.keys(): invocation_context["labels"] = labels - if documents and "documents" not in invocation_context.keys(): + if documents != None and "documents" not in invocation_context.keys(): invocation_context["documents"] = documents if meta and "meta" not in invocation_context.keys():