Skip to content

Commit 105bab5

Browse files
authored
Merge pull request #80 from pinecone-io/sc-13383/add-metadata-filter-to-describe-index-stats
Sc 13383/add metadata filter to describe index stats
2 parents 9f6478d + 3539163 commit 105bab5

11 files changed

+593
-57
lines changed

pinecone/core/client/api/vector_operations_api.py

Lines changed: 123 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
validate_and_convert_types
2828
)
2929
from pinecone.core.client.model.delete_request import DeleteRequest
30+
from pinecone.core.client.model.describe_index_stats_request import DescribeIndexStatsRequest
3031
from pinecone.core.client.model.describe_index_stats_response import DescribeIndexStatsResponse
3132
from pinecone.core.client.model.fetch_response import FetchResponse
3233
from pinecone.core.client.model.query_request import QueryRequest
@@ -297,6 +298,7 @@ def __delete1(
297298

298299
def __describe_index_stats(
299300
self,
301+
describe_index_stats_request,
300302
**kwargs
301303
):
302304
"""DescribeIndexStats # noqa: E501
@@ -305,9 +307,11 @@ def __describe_index_stats(
305307
This method makes a synchronous HTTP request by default. To make an
306308
asynchronous HTTP request, please pass async_req=True
307309
308-
>>> thread = api.describe_index_stats(async_req=True)
310+
>>> thread = api.describe_index_stats(describe_index_stats_request, async_req=True)
309311
>>> result = thread.get()
310312
313+
Args:
314+
describe_index_stats_request (DescribeIndexStatsRequest):
311315
312316
Keyword Args:
313317
_return_http_data_only (bool): response data without head status
@@ -354,6 +358,8 @@ def __describe_index_stats(
354358
'_check_return_type', True
355359
)
356360
kwargs['_host_index'] = kwargs.get('_host_index')
361+
kwargs['describe_index_stats_request'] = \
362+
describe_index_stats_request
357363
return self.call_with_http_info(**kwargs)
358364

359365
self.describe_index_stats = _Endpoint(
@@ -364,6 +370,121 @@ def __describe_index_stats(
364370
],
365371
'endpoint_path': '/describe_index_stats',
366372
'operation_id': 'describe_index_stats',
373+
'http_method': 'POST',
374+
'servers': None,
375+
},
376+
params_map={
377+
'all': [
378+
'describe_index_stats_request',
379+
],
380+
'required': [
381+
'describe_index_stats_request',
382+
],
383+
'nullable': [
384+
],
385+
'enum': [
386+
],
387+
'validation': [
388+
]
389+
},
390+
root_map={
391+
'validations': {
392+
},
393+
'allowed_values': {
394+
},
395+
'openapi_types': {
396+
'describe_index_stats_request':
397+
(DescribeIndexStatsRequest,),
398+
},
399+
'attribute_map': {
400+
},
401+
'location_map': {
402+
'describe_index_stats_request': 'body',
403+
},
404+
'collection_format_map': {
405+
}
406+
},
407+
headers_map={
408+
'accept': [
409+
'application/json'
410+
],
411+
'content_type': [
412+
'application/json'
413+
]
414+
},
415+
api_client=api_client,
416+
callable=__describe_index_stats
417+
)
418+
419+
def __describe_index_stats1(
420+
self,
421+
**kwargs
422+
):
423+
"""DescribeIndexStats # noqa: E501
424+
425+
The `DescribeIndexStats` operation returns statistics about the index's contents. For example: The vector count per namespace and the number of dimensions. # noqa: E501
426+
This method makes a synchronous HTTP request by default. To make an
427+
asynchronous HTTP request, please pass async_req=True
428+
429+
>>> thread = api.describe_index_stats1(async_req=True)
430+
>>> result = thread.get()
431+
432+
433+
Keyword Args:
434+
_return_http_data_only (bool): response data without head status
435+
code and headers. Default is True.
436+
_preload_content (bool): if False, the urllib3.HTTPResponse object
437+
will be returned without reading/decoding response data.
438+
Default is True.
439+
_request_timeout (int/float/tuple): timeout setting for this request. If
440+
one number provided, it will be total request timeout. It can also
441+
be a pair (tuple) of (connection, read) timeouts.
442+
Default is None.
443+
_check_input_type (bool): specifies if type checking
444+
should be done one the data sent to the server.
445+
Default is True.
446+
_check_return_type (bool): specifies if type checking
447+
should be done one the data received from the server.
448+
Default is True.
449+
_host_index (int/None): specifies the index of the server
450+
that we want to use.
451+
Default is read from the configuration.
452+
async_req (bool): execute request asynchronously
453+
454+
Returns:
455+
DescribeIndexStatsResponse
456+
If the method is called asynchronously, returns the request
457+
thread.
458+
"""
459+
kwargs['async_req'] = kwargs.get(
460+
'async_req', False
461+
)
462+
kwargs['_return_http_data_only'] = kwargs.get(
463+
'_return_http_data_only', True
464+
)
465+
kwargs['_preload_content'] = kwargs.get(
466+
'_preload_content', True
467+
)
468+
kwargs['_request_timeout'] = kwargs.get(
469+
'_request_timeout', None
470+
)
471+
kwargs['_check_input_type'] = kwargs.get(
472+
'_check_input_type', True
473+
)
474+
kwargs['_check_return_type'] = kwargs.get(
475+
'_check_return_type', True
476+
)
477+
kwargs['_host_index'] = kwargs.get('_host_index')
478+
return self.call_with_http_info(**kwargs)
479+
480+
self.describe_index_stats1 = _Endpoint(
481+
settings={
482+
'response_type': (DescribeIndexStatsResponse,),
483+
'auth': [
484+
'ApiKeyAuth'
485+
],
486+
'endpoint_path': '/describe_index_stats',
487+
'operation_id': 'describe_index_stats1',
367488
'http_method': 'GET',
368489
'servers': None,
369490
},
@@ -399,7 +520,7 @@ def __describe_index_stats(
399520
'content_type': [],
400521
},
401522
api_client=api_client,
402-
callable=__describe_index_stats
523+
callable=__describe_index_stats1
403524
)
404525

405526
def __fetch(

0 commit comments

Comments
 (0)