Open 0xDTE opened 10 months ago
torvalds.dev is analyzing the ticket
The issue is about adding an error statement when the deletion of a Pinecone index fails.
From the provided code, the deletion of a Pinecone index is handled in the delete
method of the PineconeVectorStore
class in the llama_index/vector_stores/pinecone.py
file.
Here is the relevant code snippet:
def delete(self, ref_doc_id: str, **delete_kwargs: Any) -> None:
"""
Delete nodes using with ref_doc_id.
Args:
ref_doc_id (str): The doc_id of the document to delete.
"""
# delete by filtering on the doc_id metadata
self._pinecone_index.delete(
filter={"doc_id": {"$eq": ref_doc_id}},
namespace=self.namespace,
**delete_kwargs,
)
Currently, the method does not handle any exceptions or errors that might occur during the deletion process.
To address the issue, we can modify the delete
method to catch exceptions during the deletion process and log an error message.
Here is a plan to address the issue:
delete
method in the PineconeVectorStore
class to catch exceptions during the deletion process.delete
method to ensure that it works as expected.Relevant files to the issue:
llama_index/vector_stores/pinecone.py
: This file contains the PineconeVectorStore
class where the delete
method is defined.llama_index/readers/pinecone.py
: This file might be relevant as it contains the PineconeReader
class which might interact with the PineconeVectorStore
class.
Feature Description
Add error statement when pinecone index deletion fails so that we gracefully fail.
Reason
No response
Value of Feature
No response