Open
Description
Is this a new bug?
- I believe this is a new bug
- I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug
Describe the bug
When using index.fetch, I receive
pinecone.core.openapi.shared.exceptions.PineconeApiAttributeError: FetchResponse has no attribute '0' at ['['received_data']']
Error information
Traceback (most recent call last):
File "/Users/peterkarman/git/DryRunSec/random_scripts/pinecone-finder/get_summaries_for_pr.py", line 26, in <module>
for v in index.fetch(test, namespace=customer_namespace):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/peterkarman/git/DryRunSec/random_scripts/pinecone-finder/.venv/lib/python3.12/site-packages/pinecone/core/openapi/shared/model_utils.py", line 446, in __getitem__
raise PineconeApiAttributeError(
pinecone.core.openapi.shared.exceptions.PineconeApiAttributeError: FetchResponse has no attribute '0' at ['['received_data']']
Steps to reproduce the issue locally
test = ['my_id']
for v in index.fetch(test, namespace='my_namespace'):
print(v.id)
Environment
- OS Version: Mac OSX
- Python version: 3.12.7
- Python SDK version: All versions
Additional context
Via direct call with curl, I get data back as expected. Appears to be an issue in the sdk
in reality, my ids come from so I know these are real ids. I have tried hardcoding some as a test
pc = Pinecone(api_key=pinecone_api_key)
index = pc.Index(index_name)
id_iterator = index.list(prefix=f"my_prefix", limit=3, namespace="my_namespace")
for ids in id_iterator:
print(ids)
vectors = index.fetch(ids, namespace=customer_namespace)