Skip to content

Commit 8a2d2e5

Browse files
Regenerate code from 2025-10, implement schema/read_capacity in BYOCSpec (#614)
## Problem When the Python client was released for `2025-10`, the spec did not yet include `BYOCSpec.read_capacity`, so the ability to configure BYOC indexes with DRN is limited through the SDK. Additionally, I noticed we never pulled in `BYOCSpec.schema` either, so that can be added in as well. ## Solution - Regenerate core off of the `2025-10` spec to pull in most recent changes (`make generate-oas`). We shouldn't need to regenerate grpc for this as the changes are limited to `BYOCSpec` in the control plane. - Add support for `schema` and `read_capacity` to `BYOCSpec`, and make sure things are wired properly in `request_factory.py`. - Update references to `BackupModelSchema` to use `MetadataSchema`. This was due to an error in the spec wherein the `MetadataSchema` in the OpenAPI spec did not have an `x-component-name`. That was fixed here: pinecone-io/apis#417. It's confusing to have `BackupModelSchema` used in all these areas that aren't backup-related. Also pulled in some dependency bumps based on dependabot alerts: ### `aiohttp` (`2.6.3`) - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/42 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/47 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/46 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/48 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/45 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/44 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/49 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/43 ### `urllib3` (`3.13.3`) - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/39 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/40 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/50 ### `filelock` (`3.21.0`) - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/41 - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/51 ### `virtualenv` (`20.31.1`) - https://github.com/pinecone-io/pinecone-python-client/security/dependabot/52 ## Type of Change - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Infrastructure change (CI configs, etc) - [ ] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan CI - unit, integration, etc <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches generated API models plus request/response (de)serialization for index specs, so mismatches could surface at runtime when parsing `spec`/`read_capacity` payloads. Added tests reduce risk but changes affect core index management flows. > > **Overview** > Updates codegen to the `2025-10` OpenAPI output and refreshes generated docs/comments (including index-management and vector fetch/query guidance). > > Extends BYOC index support by adding `read_capacity` and `schema` wiring end-to-end: new `ByocSpecResponse` model, `ByocSpec` dataclass serialization, request factory parsing for BYOC `read_capacity`/`schema`, and `IndexModel` response deserialization fixes (manual oneOf handling + shared `_deserialize_read_capacity`, with relaxed type checking to avoid request/response type mismatches). > > Renames the generated metadata schema types from `BackupModelSchema*` to `MetadataSchema*` across control-plane models and public interfaces, and expands unit/fixture coverage for schema parsing and BYOC/serverless read-capacity configuration; also tweaks a sparse-index error assertion and Ruff `target-version` to `py310`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1976ce9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1213198931647510
1 parent 72f958f commit 8a2d2e5

35 files changed

Lines changed: 1172 additions & 323 deletions

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type-check:
2525
uv run mypy pinecone --exclude pinecone/core
2626

2727
generate-oas:
28-
./codegen/build-oas.sh "2024-07"
28+
./codegen/build-oas.sh "2025-10"
2929

3030
version:
3131
@python -c "import re; print(re.search(r'version = \"([^\"]+)\"', open('pyproject.toml').read()).group(1))"

‎codegen/apis‎

Submodule apis updated from c968f9d to be7f2b2

‎codegen/python-oas-templates‎

‎pinecone/core/openapi/db_control/api/manage_indexes_api.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __configure_index(
7272
) -> IndexModel | ApplyResult[IndexModel]:
7373
"""Configure an index # noqa: E501
7474
75-
Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501
75+
Configure an existing index. For guidance and examples, see [Manage indexes](https://docs.pinecone.io/guides/manage-data/manage-indexes). # noqa: E501
7676
This method makes a synchronous HTTP request by default. To make an
7777
asynchronous HTTP request, please pass async_req=True
7878
@@ -1562,7 +1562,7 @@ async def __configure_index(
15621562
) -> IndexModel:
15631563
"""Configure an index # noqa: E501
15641564
1565-
Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501
1565+
Configure an existing index. For guidance and examples, see [Manage indexes](https://docs.pinecone.io/guides/manage-data/manage-indexes). # noqa: E501
15661566
15671567
15681568
Args:

‎pinecone/core/openapi/db_control/model/backup_model.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
from typing import TYPE_CHECKING
3030

3131
if TYPE_CHECKING:
32-
from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema
3332
from pinecone.core.openapi.db_control.model.index_tags import IndexTags
33+
from pinecone.core.openapi.db_control.model.metadata_schema import MetadataSchema
3434

3535

3636
def lazy_import():
37-
from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema
3837
from pinecone.core.openapi.db_control.model.index_tags import IndexTags
38+
from pinecone.core.openapi.db_control.model.metadata_schema import MetadataSchema
3939

40-
globals()["BackupModelSchema"] = BackupModelSchema
4140
globals()["IndexTags"] = IndexTags
41+
globals()["MetadataSchema"] = MetadataSchema
4242

4343

4444
from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar
@@ -112,7 +112,7 @@ def openapi_types(cls):
112112
"description": (str,), # noqa: E501
113113
"dimension": (int,), # noqa: E501
114114
"metric": (str,), # noqa: E501
115-
"schema": (BackupModelSchema,), # noqa: E501
115+
"schema": (MetadataSchema,), # noqa: E501
116116
"record_count": (int,), # noqa: E501
117117
"namespace_count": (int,), # noqa: E501
118118
"size_bytes": (int,), # noqa: E501
@@ -216,7 +216,7 @@ def _from_openapi_data(
216216
description (str): Optional description providing context for the backup. [optional] # noqa: E501
217217
dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501
218218
metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the `vector_type` is `dense`, the metric defaults to 'cosine'. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501
219-
schema (BackupModelSchema): [optional] # noqa: E501
219+
schema (MetadataSchema): [optional] # noqa: E501
220220
record_count (int): Total number of records in the backup. [optional] # noqa: E501
221221
namespace_count (int): Number of namespaces in the backup. [optional] # noqa: E501
222222
size_bytes (int): Size of the backup in bytes. [optional] # noqa: E501
@@ -331,7 +331,7 @@ def __init__(
331331
description (str): Optional description providing context for the backup. [optional] # noqa: E501
332332
dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501
333333
metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the `vector_type` is `dense`, the metric defaults to 'cosine'. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501
334-
schema (BackupModelSchema): [optional] # noqa: E501
334+
schema (MetadataSchema): [optional] # noqa: E501
335335
record_count (int): Total number of records in the backup. [optional] # noqa: E501
336336
namespace_count (int): Number of namespaces in the backup. [optional] # noqa: E501
337337
size_bytes (int): Size of the backup in bytes. [optional] # noqa: E501

‎pinecone/core/openapi/db_control/model/byoc_spec.py‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
from typing import TYPE_CHECKING
3030

3131
if TYPE_CHECKING:
32-
from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema
32+
from pinecone.core.openapi.db_control.model.metadata_schema import MetadataSchema
33+
from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity
3334

3435

3536
def lazy_import():
36-
from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema
37+
from pinecone.core.openapi.db_control.model.metadata_schema import MetadataSchema
38+
from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity
3739

38-
globals()["BackupModelSchema"] = BackupModelSchema
40+
globals()["MetadataSchema"] = MetadataSchema
41+
globals()["ReadCapacity"] = ReadCapacity
3942

4043

4144
from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar
@@ -98,7 +101,8 @@ def openapi_types(cls):
98101
lazy_import()
99102
return {
100103
"environment": (str,), # noqa: E501
101-
"schema": (BackupModelSchema,), # noqa: E501
104+
"read_capacity": (ReadCapacity,), # noqa: E501
105+
"schema": (MetadataSchema,), # noqa: E501
102106
}
103107

104108
@cached_class_property
@@ -107,6 +111,7 @@ def discriminator(cls):
107111

108112
attribute_map: Dict[str, str] = {
109113
"environment": "environment", # noqa: E501
114+
"read_capacity": "read_capacity", # noqa: E501
110115
"schema": "schema", # noqa: E501
111116
}
112117

@@ -164,7 +169,8 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa
164169
Animal class but this time we won't travel
165170
through its discriminator because we passed in
166171
_visited_composed_classes = (Animal,)
167-
schema (BackupModelSchema): [optional] # noqa: E501
172+
read_capacity (ReadCapacity): [optional] # noqa: E501
173+
schema (MetadataSchema): [optional] # noqa: E501
168174
"""
169175

170176
_enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False)
@@ -258,7 +264,8 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501
258264
Animal class but this time we won't travel
259265
through its discriminator because we passed in
260266
_visited_composed_classes = (Animal,)
261-
schema (BackupModelSchema): [optional] # noqa: E501
267+
read_capacity (ReadCapacity): [optional] # noqa: E501
268+
schema (MetadataSchema): [optional] # noqa: E501
262269
"""
263270

264271
_enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True)

0 commit comments

Comments
 (0)