Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pinecone/core/grpc/index_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ def parse_fetch_response(response: dict):
return FetchResponse(vectors=vd, namespace=namespace, _check_type=False)


def parse_query_response(response: dict, unary_query: bool):
def parse_query_response(response: dict, unary_query: bool, _check_type: bool = False):
Comment thread
igiloh-pinecone marked this conversation as resolved.
Resolved
res = []

# TODO: consider deleting this deprecated case
for match in response.get('results', []):
namespace = match.get('namespace', '')
m = []
Comment thread
igiloh-pinecone marked this conversation as resolved.
Resolved
Expand All @@ -186,10 +187,10 @@ def parse_query_response(response: dict, unary_query: bool):
m = []
for item in response.get('matches', []):
sc = ScoredVector(id=item['id'], score=item.get('score', 0.0), values=item.get('values', []),
metadata=item.get('metadata', {}))
metadata=item.get('metadata', {}), _check_type=_check_type)
m.append(sc)

kwargs = {'check_type': False}
kwargs = {'_check_type': _check_type}
if unary_query:
kwargs['namespace'] = response.get('namespace', '')
kwargs['matches'] = m
Expand Down Expand Up @@ -463,7 +464,7 @@ def _query_transform(item):
timeout = kwargs.pop('timeout', None)
response = self._wrap_grpc_call(self.stub.Query, request, timeout=timeout)
json_response = json_format.MessageToDict(response)
return parse_query_response(json_response, vector is not None or id)
return parse_query_response(json_response, vector is not None or id, _check_type=False)

def update(self,
id: str,
Expand Down