Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 11 additions & 5 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ jobs:
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
strategy:
fail-fast: false
matrix:
python_version: [3.9, 3.12]
test_suite:
- tests/integration/control/index
- tests/integration/control/collections
- tests/integration/control/backup
- tests/integration/control/restore_job
- tests/integration/control_asyncio/index
- tests/integration/control_asyncio/backup
- tests/integration/control_asyncio/restore_job
steps:
- uses: actions/checkout@v4
- name: 'Set up Python ${{ matrix.python_version }}'
Expand All @@ -23,11 +32,8 @@ jobs:
uses: ./.github/actions/setup-poetry
with:
include_asyncio: true
- name: 'Run index tests'
run: poetry run pytest tests/integration/control/index --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
- name: 'Run collection tests'
run: poetry run pytest tests/integration/control/collections --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG

- name: 'Run tests'
run: poetry run pytest ${{ matrix.test_suite }} --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG

inference:
name: Inference tests
Expand Down
2 changes: 1 addition & 1 deletion codegen/apis
Submodule apis updated from ba143a to 09015d
2 changes: 1 addition & 1 deletion codegen/python-oas-templates
4 changes: 4 additions & 0 deletions pinecone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
"PodSpec": ("pinecone.db_control.models", "PodSpec"),
"PodSpecDefinition": ("pinecone.db_control.models", "PodSpecDefinition"),
"PodType": ("pinecone.db_control.enums", "PodType"),
"RestoreJobModel": ("pinecone.db_control.models", "RestoreJobModel"),
"RestoreJobList": ("pinecone.db_control.models", "RestoreJobList"),
"BackupModel": ("pinecone.db_control.models", "BackupModel"),
"BackupList": ("pinecone.db_control.models", "BackupList"),
}

_config_lazy_imports = {
Expand Down
73 changes: 46 additions & 27 deletions pinecone/core/openapi/db_control/api/manage_indexes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
from pinecone.core.openapi.db_control.model.create_index_from_backup_request import (
CreateIndexFromBackupRequest,
)
from pinecone.core.openapi.db_control.model.create_index_from_backup_response import (
CreateIndexFromBackupResponse,
)
from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest
from pinecone.core.openapi.db_control.model.error_response import ErrorResponse
from pinecone.core.openapi.db_control.model.index_list import IndexList
Expand Down Expand Up @@ -281,7 +284,7 @@ def __create_collection(
def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTypedDict):
"""Create an index # noqa: E501

Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501
Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index). # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down Expand Up @@ -352,7 +355,7 @@ def __create_index_for_model(
):
"""Create an index with integrated embedding # noqa: E501

Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). # noqa: E501
Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index#integrated-embedding). # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down Expand Up @@ -418,7 +421,7 @@ def __create_index_for_model(
callable=__create_index_for_model,
)

def __create_index_from_backup(
def __create_index_from_backup_operation(
self, backup_id, create_index_from_backup_request, **kwargs: ExtraOpenApiKwargsTypedDict
):
"""Create an index from a backup # noqa: E501
Expand All @@ -427,7 +430,7 @@ def __create_index_from_backup(
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.create_index_from_backup(backup_id, create_index_from_backup_request, async_req=True)
>>> thread = api.create_index_from_backup_operation(backup_id, create_index_from_backup_request, async_req=True)
>>> result = thread.get()

Args:
Expand All @@ -453,7 +456,7 @@ def __create_index_from_backup(
async_req (bool): execute request asynchronously

Returns:
None
CreateIndexFromBackupResponse
If the method is called asynchronously, returns the request
thread.
"""
Expand All @@ -462,12 +465,12 @@ def __create_index_from_backup(
kwargs["create_index_from_backup_request"] = create_index_from_backup_request
return self.call_with_http_info(**kwargs)

self.create_index_from_backup = _Endpoint(
self.create_index_from_backup_operation = _Endpoint(
settings={
"response_type": None,
"response_type": (CreateIndexFromBackupResponse,),
"auth": ["ApiKeyAuth"],
"endpoint_path": "/backups/{backup_id}/create-index",
"operation_id": "create_index_from_backup",
"operation_id": "create_index_from_backup_operation",
"http_method": "POST",
"servers": None,
},
Expand All @@ -491,7 +494,7 @@ def __create_index_from_backup(
},
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
api_client=api_client,
callable=__create_index_from_backup,
callable=__create_index_from_backup_operation,
)

def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict):
Expand Down Expand Up @@ -1192,6 +1195,8 @@ def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict):


Keyword Args:
limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10.
pagination_token (str): The token to use to retrieve the next page of results. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down Expand Up @@ -1226,13 +1231,19 @@ def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict):
"http_method": "GET",
"servers": None,
},
params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
params_map={
"all": ["limit", "pagination_token"],
"required": [],
"nullable": [],
"enum": [],
"validation": ["limit"],
},
root_map={
"validations": {},
"validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}},
"allowed_values": {},
"openapi_types": {},
"attribute_map": {},
"location_map": {},
"openapi_types": {"limit": (int,), "pagination_token": (str,)},
"attribute_map": {"limit": "limit", "pagination_token": "paginationToken"},
"location_map": {"limit": "query", "pagination_token": "query"},
"collection_format_map": {},
},
headers_map={"accept": ["application/json"], "content_type": []},
Expand Down Expand Up @@ -1519,7 +1530,7 @@ async def __create_collection(self, create_collection_request, **kwargs):
async def __create_index(self, create_index_request, **kwargs):
"""Create an index # noqa: E501

Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501
Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index). # noqa: E501


Args:
Expand Down Expand Up @@ -1581,7 +1592,7 @@ async def __create_index(self, create_index_request, **kwargs):
async def __create_index_for_model(self, create_index_for_model_request, **kwargs):
"""Create an index with integrated embedding # noqa: E501

Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). # noqa: E501
Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index#integrated-embedding). # noqa: E501


Args:
Expand Down Expand Up @@ -1640,7 +1651,7 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg
callable=__create_index_for_model,
)

async def __create_index_from_backup(
async def __create_index_from_backup_operation(
self, backup_id, create_index_from_backup_request, **kwargs
):
"""Create an index from a backup # noqa: E501
Expand Down Expand Up @@ -1670,19 +1681,19 @@ async def __create_index_from_backup(
Default is True.

Returns:
None
CreateIndexFromBackupResponse
"""
self._process_openapi_kwargs(kwargs)
kwargs["backup_id"] = backup_id
kwargs["create_index_from_backup_request"] = create_index_from_backup_request
return await self.call_with_http_info(**kwargs)

self.create_index_from_backup = _AsyncioEndpoint(
self.create_index_from_backup_operation = _AsyncioEndpoint(
settings={
"response_type": None,
"response_type": (CreateIndexFromBackupResponse,),
"auth": ["ApiKeyAuth"],
"endpoint_path": "/backups/{backup_id}/create-index",
"operation_id": "create_index_from_backup",
"operation_id": "create_index_from_backup_operation",
"http_method": "POST",
"servers": None,
},
Expand All @@ -1706,7 +1717,7 @@ async def __create_index_from_backup(
},
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
api_client=api_client,
callable=__create_index_from_backup,
callable=__create_index_from_backup_operation,
)

async def __delete_backup(self, backup_id, **kwargs):
Expand Down Expand Up @@ -2333,6 +2344,8 @@ async def __list_project_backups(self, **kwargs):


Keyword Args:
limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10.
pagination_token (str): The token to use to retrieve the next page of results. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down Expand Up @@ -2364,13 +2377,19 @@ async def __list_project_backups(self, **kwargs):
"http_method": "GET",
"servers": None,
},
params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
params_map={
"all": ["limit", "pagination_token"],
"required": [],
"nullable": [],
"enum": [],
"validation": ["limit"],
},
root_map={
"validations": {},
"validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}},
"allowed_values": {},
"openapi_types": {},
"attribute_map": {},
"location_map": {},
"openapi_types": {"limit": (int,), "pagination_token": (str,)},
"attribute_map": {"limit": "limit", "pagination_token": "paginationToken"},
"location_map": {"limit": "query", "pagination_token": "query"},
"collection_format_map": {},
},
headers_map={"accept": ["application/json"], "content_type": []},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar
from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property

T = TypeVar("T", bound="DedicatedSpec")
T = TypeVar("T", bound="ByocSpec")


class DedicatedSpec(ModelNormal):
class ByocSpec(ModelNormal):
"""NOTE: This class is @generated using OpenAPI.

Do not edit the class manually.
Expand Down Expand Up @@ -102,7 +102,7 @@ def discriminator(cls):
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa: E501
"""DedicatedSpec - a model defined in OpenAPI
"""ByocSpec - a model defined in OpenAPI

Args:
environment (str): The environment where the index is hosted.
Expand Down Expand Up @@ -189,7 +189,7 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa

@convert_js_args_to_python_args
def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501
"""DedicatedSpec - a model defined in OpenAPI
"""ByocSpec - a model defined in OpenAPI

Args:
environment (str): The environment where the index is hosted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class CreateBackupRequest(ModelNormal):

allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {}

validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {
("name",): {"max_length": 45, "min_length": 1}
}
validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {}

@cached_class_property
def additional_properties_type(cls):
Expand Down Expand Up @@ -139,7 +137,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. [optional] # noqa: E501
name (str): The name of the backup. [optional] # noqa: E501
description (str): A description of the backup. [optional] # noqa: E501
"""

Expand Down Expand Up @@ -224,7 +222,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. [optional] # noqa: E501
name (str): The name of the backup. [optional] # noqa: E501
description (str): A description of the backup. [optional] # noqa: E501
"""

Expand Down
Loading
Loading