Bugfix - save_to_yaml for OpenSearchDocumentStore (#2017)

* fix save_to_yaml

* add link to issue

* added generic implementation

* added type

* remove not used imports
This commit is contained in:
Kristof Herrmann 2022-01-19 10:10:50 +01:00 committed by GitHub
parent ea10d011ab
commit 6267476015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -717,7 +717,12 @@ class Pipeline(BasePipeline):
component_type = component_instance.pipeline_config["type"]
component_params = component_instance.pipeline_config["params"]
components[node] = {"name": node, "type": component_type, "params": {}}
component_signature = inspect.signature(type(component_instance)).parameters
component_parent_classes = inspect.getmro(type(component_instance))
component_signature: dict = {}
for component_parent in component_parent_classes:
component_signature = {**component_signature, **inspect.signature(component_parent).parameters}
for key, value in component_params.items():
# A parameter for a Component could be another Component. For instance, a Retriever has
# the DocumentStore as a parameter.