Is this a new bug?
Current Behavior
My python code has been using Index.search() method to query an index for a semantic search, running on v8.1.0 pinecone python sdk version.
Since 5-6 days ago, it has started throwing the following error:
Index.search() got an unexpected keyword argument 'query'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/opentelemetry/trace/__init__.py", line 619, in use_span
yield span
File "/usr/local/lib/python3.11/site-packages/opentelemetry/sdk/trace/__init__.py", line 1173, in start_as_current_span
yield span
File "/app/services/tools/lms_pinecone_service.py", line 62, in vector_search_pinecone
results = self._index.search(
^^^^^^^^^^^^^^^^^^^
TypeError: Index.search() got an unexpected keyword argument 'query'
Relevant Code Block:
query_dict = {
"inputs": {"text": query["query"]},
"top_k": top_k,
"filter": filter_dict}
results = self._index.search(
namespace=self._namespace,
query=query_dict,
fields=["text", "answer"]
)
Expected Behavior
The error should not be shown and it should be working as intended.
Currently there are two ways I could find out to fix this issue:
- Upgrade to pinecone v9.0.0 and use
Index.search() in the following way:
self._index.search(
namespace=self._namespace, # Update to capture from .env
inputs={"text": query['query']},
top_k=top_k,
filter = filter_dict,
fields=["text", "answer"]
)
- Or keep the same query parameters and use
Index.search_records() instead.
I would like to understand why this particular function suddenly started breaking, and/or if the function has been deprecated. I could not find any relevant changelog or migration guide for the same, especially since my Pinecone python sdk version has been unchanged.
If I did miss any release notes or changelog for this particular function(ality), please do let me know so I can keep an eye on it in the future as well.
Steps To Reproduce
- Running in a Docker Container, relevant DockerFile:
FROM --platform=linux/amd64 python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
-
Install pinecone python sdk version pinecone==8.1.0
-
Execute Index.search() in the following manner:
results = self._index.search(
namespace=self._namespace,
query=query_dict,
fields=["text", "answer"]
)
Relevant log output
Index.search() got an unexpected keyword argument 'query'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/opentelemetry/trace/__init__.py", line 619, in use_span
yield span
File "/usr/local/lib/python3.11/site-packages/opentelemetry/sdk/trace/__init__.py", line 1173, in start_as_current_span
yield span
File "/app/services/tools/lms_pinecone_service.py", line 62, in vector_search_pinecone
results = self._index.search(
^^^^^^^^^^^^^^^^^^^
TypeError: Index.search() got an unexpected keyword argument 'query'
Environment
Additional Context
No response
Is this a new bug?
Current Behavior
My python code has been using
Index.search()method to query an index for a semantic search, running on v8.1.0 pinecone python sdk version.Since 5-6 days ago, it has started throwing the following error:
Relevant Code Block:
Expected Behavior
The error should not be shown and it should be working as intended.
Currently there are two ways I could find out to fix this issue:
Index.search()in the following way:Index.search_records()instead.I would like to understand why this particular function suddenly started breaking, and/or if the function has been deprecated. I could not find any relevant changelog or migration guide for the same, especially since my Pinecone python sdk version has been unchanged.
If I did miss any release notes or changelog for this particular function(ality), please do let me know so I can keep an eye on it in the future as well.
Steps To Reproduce
Install pinecone python sdk version
pinecone==8.1.0Execute
Index.search()in the following manner:Relevant log output
Environment
Additional Context
No response