Repository navigation
Closed
Labels
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.03Additional Context
none
Reacted by Chris Belsole and Rob
Activity
volksport commentedon Apr 17, 2024
Can confirm this is also an issue for us
shamussim-ai commentedon Apr 24, 2024
Hi there, any updates on this? Thank you
daverigby commentedon May 3, 2024
I attempted to reproduce this on the latest version (v4.0.0) on macOS and don't see the problem anymore.
cbelsole commentedon Aug 5, 2024
@daverigby I finally figured out why this was not working. This only works for a serverless index. The error message could probably be clearer.
daverigby commentedon Aug 6, 2024
Thanks @cbelsole . I'll re-open and change to cover the fact that the error is not clear for non-server less indexes.
[-][Bug] index.list to List Vector IDs dont work [/-][+][Bug] index.list() error message for non-serverless indexes is unclear[/+]gildemberg-santos commentedon Oct 30, 2024
Additionally, this issue is occurring in version 5.3.1, and I experienced it on Google Cloud Run
brysonwxx commentedon Dec 25, 2024
hi, I also encounter the same error. @daverigby @volksport
python: 3.8.10
pinecone-client: 5.0.1
when I create an Pinecone instance:
self.pc_cli = Pinecone(api_key=self.api_key, host=self.host, pool_threads=self.POOL_THREADS)and call the functions:
self.pc_cli.describe_index(collection_name), orr = self.pc_cli.list_indexes(),it raises the error:
File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/control/pinecone.py", line 541, in describe_index description = api_instance.describe_index(name) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 761, in __call__ return self.callable(self, *args, **kwargs) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/control/api/manage_indexes_api.py", line 632, in __describe_index return self.call_with_http_info(**kwargs) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 819, in call_with_http_info return self.api_client.call_api( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 380, in call_api return self.__call_api( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 208, in __call_api return_data = self.deserialize(response_data, response_type, _check_type) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 301, in deserialize deserialized_data = validate_and_convert_types( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/model_utils.py", line 1441, in validate_and_convert_types converted_instance = attempt_convert_item( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/model_utils.py", line 1326, in attempt_convert_item raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type) pinecone.core.openapi.shared.exceptions.PineconeApiTypeError: Invalid type for variable 'received_data'. Required value type is IndexModel and passed type was str at ['received_data']any suggestions for this? thanks!
brysonwxx commentedon Dec 26, 2024
But, when I create the Pinecone instance by
self.pc_cli = Pinecone(api_key=self.api_key, pool_threads=self.POOL_THREADS), i.e., dont pass the parameter:host=self.host, it's ok.Bump loguru from 0.5.0 to 0.5.3 (pinecone-io#206)
feat(tooling): bogus-version sentinel probe — a fixture-free "is our …
docs(tooling): document why the version-sentinel probe excludes respo…