Open
Description
Is this a new bug in the Pinecone Python client?
- I believe this is a new bug in the Pinecone Python Client
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I followed the code exactly from the documentation
from pinecone import Pinecone
pc = Pinecone(api_key='34zzzzzzzzzz')
index = pc.Index('self-retriever-pae')
# To iterate over all result pages using a generator function
for ids in index.list( namespace="Non_Varicea"):
print(ids)
This succeeds (as expected) against a serverless index, but when run on a pod-based index (which indeed does not support list()
) an unclear error message is returned:
PineconeApiTypeError: Invalid type for variable 'received_data'. Required value type is ListResponse and passed type was str at ['received_data']
Expected Behavior
When run on a non-serverless index (which do not support list()
) a clear error message that this is an unsupported operation should be displayed.
Steps To Reproduce
Run code using env specified
Code
from pinecone import Pinecone
pc = Pinecone(api_key='34zzzzzzzzzz')
index = pc.Index('self-retriever-pae')
# To iterate over all result pages using a generator function
for ids in index.list( namespace="Non_Varicea"):
print(ids)
Relevant log output
PineconeApiTypeError Traceback (most recent call last)
[<ipython-input-10-ccee60efe570>](https://localhost:8080/#) in <cell line: 8>()
6
7 # To iterate over all result pages using a generator function
----> 8 for ids in index.list( namespace="Non_Variceal_hi_res"):
9 print(ids)
10 frames
[/usr/local/lib/python3.10/dist-packages/pinecone/core/client/model_utils.py](https://localhost:8080/#) in attempt_convert_item(input_value, valid_classes, path_to_item, configuration, spec_property_naming, key_type, must_convert, check_type)
1419 if configuration is None or not configuration.discard_unknown_keys:
1420 raise get_type_error(input_value, path_to_item, valid_classes,
-> 1421 key_type=key_type)
1422 for valid_class in valid_classes_coercible:
1423 try:
PineconeApiTypeError: Invalid type for variable 'received_data'. Required value type is ListResponse and passed type was str at ['received_data']
Environment
- OS:Windows
- Python:3.11
- pinecone: 3.0.03
Additional Context
none