haystack-core-integrations icon indicating copy to clipboard operation
haystack-core-integrations copied to clipboard

Error when serializing ElasticSearchEmbeddingRetriever from ElasticSearchDocumentStore with authentication

Open IronD7 opened this issue 1 year ago • 1 comments

Dear developers,

I'm using an ElasticSearchDocumentStore with authentication like so:

document_store = ElasticsearchDocumentStore(hosts = "https://localhost:9200",
                                            index = INDEX,
                                           basic_auth=("elastic", ELASTIC_PASSWORD),
                                           ssl_assert_fingerprint=CERT_FINGERPRINT,)

and have an ElasticsearchEmbeddingRetriever in my pipeline.

After serializing my Pipeline (relevant part of .yaml file below) and trying to deploy it in hayhooks, I get an Error message about that Python tuple:

yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple' in "", line 53, column 23: basic_auth: !!python/tuple

Is there any way to prevent this (other than using elastic without authentication)?

retriever: init_parameters: document_store: init_parameters: basic_auth: !!python/tuple - elastic - <ELASTIC_PW> hosts: https://localhost:9200 type: haystack_integrations.document_stores.elasticsearch.document_store.ElasticsearchDocumentStore filters: {} num_candidates: null top_k: 10 type: haystack_integrations.components.retrievers.elasticsearch.embedding_retriever.ElasticsearchEmbeddingRetriever

IronD7 avatar Apr 24 '24 13:04 IronD7

I noticed the same bug in the Opensearch integration.

anakin87 avatar Apr 26 '24 12:04 anakin87

Thanks for the report. The linked PR should fix this issue once it gets released in a new Haystack build.

shadeMe avatar Jun 13 '24 13:06 shadeMe