deepset-ai / deepset-ai/haystack-core-integrations
PgvectorDocumentStore - an error occurred while running the sample code in the official website documentation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 203
- Forks
- 332
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 80
Description
I am running the sample code of PgvectorDocumentStore, as follows:
The above is an example of the PgvectorDocumentStore section of the document. I executed it intact and encountered the following error:
File "F:\AWorks\work_python\ragkb\test\PythonTest.py", line 407, in
document_store.write_documents([
File "F:\AWorks\work_python\ragkb.venv\lib\site-packages\haystack_integrations\document_stores\pgvector\document_store.py", line 432, in write_documents
db_documents = self._from_haystack_to_pg_documents(documents)
File "F:\AWorks\work_python\ragkb.venv\lib\site-packages\haystack_integrations\document_stores\pgvector\document_store.py", line 486, in _from_haystack_to_pg_documents
db_document["dataframe"] = Jsonb(db_document["dataframe"]) if db_document["dataframe"] else None
KeyError: 'dataframe'
By locating the source code, I found that when document is converted into a dictionary, the old field dataframe is still needed. However, I am using version 2.13.1 and found that the dataframe field is ignored when it is converted into a dictionary. How can I solve this problem?
use haystack-ai 2.13.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with haystack_integrations/document_stores/pgvector/document_store.py, especially write_documents and _from_haystack_to_pg_documents, and compare their expected fields with the Haystack 2.13.1 Document dictionary used by the official PgvectorDocumentStore sample. Re-run the sample after investigating the mismatch and confirm that write_documents completes without the dataframe KeyError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100