From b6986ea25d7bbd06158dcb9b2f2b9187266accff Mon Sep 17 00:00:00 2001 From: tstadel <60758086+tstadel@users.noreply.github.com> Date: Wed, 25 May 2022 08:51:04 +0200 Subject: [PATCH] avoid empty api_endpoint (#2588) --- haystack/pipelines/base.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/haystack/pipelines/base.py b/haystack/pipelines/base.py index afd75cf60..c61030c3f 100644 --- a/haystack/pipelines/base.py +++ b/haystack/pipelines/base.py @@ -194,14 +194,12 @@ class Pipeline: for component_config in pipeline_config["components"]: if component_config["type"] == "DeepsetCloudDocumentStore": params = component_config.get("params", {}) - params.update( - { - "api_key": api_key, - "api_endpoint": api_endpoint, - "workspace": workspace, - "index": pipeline_config_name, - } - ) + params["index"] = pipeline_config_name + params["workspace"] = workspace + if api_endpoint is not None: + params["api_endpoint"] = api_endpoint + if api_key is not None: + params["api_key"] = api_key component_config["params"] = params del pipeline_config["name"] # Would fail validation otherwise