@@ -170,9 +170,10 @@ def parse_fetch_response(response: dict):
170
170
return FetchResponse (vectors = vd , namespace = namespace , _check_type = False )
171
171
172
172
173
- def parse_query_response (response : dict , unary_query : bool ):
173
+ def parse_query_response (response : dict , unary_query : bool , _check_type : bool = False ):
174
174
res = []
175
175
176
+ # TODO: consider deleting this deprecated case
176
177
for match in response .get ('results' , []):
177
178
namespace = match .get ('namespace' , '' )
178
179
m = []
@@ -186,10 +187,10 @@ def parse_query_response(response: dict, unary_query: bool):
186
187
m = []
187
188
for item in response .get ('matches' , []):
188
189
sc = ScoredVector (id = item ['id' ], score = item .get ('score' , 0.0 ), values = item .get ('values' , []),
189
- metadata = item .get ('metadata' , {}))
190
+ metadata = item .get ('metadata' , {}), _check_type = _check_type )
190
191
m .append (sc )
191
192
192
- kwargs = {'check_type ' : False }
193
+ kwargs = {'_check_type ' : _check_type }
193
194
if unary_query :
194
195
kwargs ['namespace' ] = response .get ('namespace' , '' )
195
196
kwargs ['matches' ] = m
@@ -463,7 +464,7 @@ def _query_transform(item):
463
464
timeout = kwargs .pop ('timeout' , None )
464
465
response = self ._wrap_grpc_call (self .stub .Query , request , timeout = timeout )
465
466
json_response = json_format .MessageToDict (response )
466
- return parse_query_response (json_response , vector is not None or id )
467
+ return parse_query_response (json_response , vector is not None or id , _check_type = False )
467
468
468
469
def update (self ,
469
470
id : str ,
0 commit comments