deepset-ai / hayhooks

Deploy Haystack pipelines behind a REST Api.
https://haystack.deepset.ai
Apache License 2.0
39 stars 11 forks source link

Errors caused by indexing.yml file #13

Closed Emil-io closed 4 months ago

Emil-io commented 5 months ago

I created a hayhooks, haystack and opensearch setup (see this github repo).

Both the query and the indexing yaml are created by dumping a working pipeline config in python.

The problem seems to be caused by the indexing.yml - Once i leave this file out, the query pipeline works without a problem.

Could you help me find the issues here? Error message I am getting when accessing the localhost under "http://0.0.0.0:1416/docs":

2024-04-29 13:38:03 json_schema = generate_for_schema_type(schema_or_field) 2024-04-29 13:38:03 File "/opt/venv/lib/python3.10/site-packages/pydantic/json_schema.py", line 765, in is_instance_schema 2024-04-29 13:38:03 return self.handle_invalid_for_json_schema(schema, f'core_schema.IsInstanceSchema ({schema["cls"]})') 2024-04-29 13:38:03 File "/opt/venv/lib/python3.10/site-packages/pydantic/json_schema.py", line 2093, in handle_invalid_for_json_schema 2024-04-29 13:38:03 raise PydanticInvalidForJsonSchema(f'Cannot generate a JsonSchema for {error_info}') 2024-04-29 13:38:03 pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.IsInstanceSchema (<class 'pandas.core.frame.DataFrame'>) 2024-04-29 13:38:03 2024-04-29 13:38:03 For further information visit https://errors.pydantic.dev/2.6/u/invalid-for-json-schema

lohit8846 commented 5 months ago

I've also seen the same issue with other types of data. Basically the pipeline execution still works, but cannot generate the docs due to this json schema generation failing

pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.IsInstanceSchema (<class 'haystack.dataclasses.sparse_embedding.SparseEmbedding'>)

lohit8846 commented 5 months ago

I believe this pull request tries to address a similar problem. https://github.com/deepset-ai/hayhooks/pull/7

silvanocerza commented 4 months ago

This is fixed with #7 and version 0.0.13.

Remember to use latest Haystack version so it works properly, I had to fix a small thing there too.