avoid empty api_endpoint (#2588)

This commit is contained in:
tstadel 2022-05-25 08:51:04 +02:00 committed by GitHub
parent 7caca41c5d
commit b6986ea25d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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