-
Notifications
You must be signed in to change notification settings - Fork 116
Regenerate code from 2025-10, implement schema/read_capacity in BYOCSpec
#614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…Schema to use MetadataSchema, add support for schema and read_capacity to BYOCSpec and make sure things are wired properly in request_factory.py
…ess and BYOC to remove duplication, fix bug when calling parse_non_empty_args for BYOC in __parse_index_spec, add unit tests to cover schema parsing logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| else: | ||
| # If not a dict, create with default filterable=True | ||
| fields[field_name] = MetadataSchemaFields(filterable=True) | ||
| byoc_args["schema"] = MetadataSchema(fields=fields) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated schema conversion bypasses existing __parse_schema helper
Low Severity
The new ByocSpec object schema handling (lines 358–371) duplicates the inline schema conversion logic from the ServerlessSpec object path (lines 316–328). Both could simply call __parse_schema(spec.schema), which already exists and is correctly used in the dict-based paths (lines 265 and 298) and in create_index_for_model_request (line 483). If __parse_schema is updated in the future, these inline copies won't benefit, creating a maintenance risk and inconsistency.
Additional Locations (1)
| raise PineconeApiAttributeError( | ||
| f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " | ||
| f"class with read only attributes." | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BYOC response deserialization missing read_capacity handling
High Severity
The PR adds read_capacity to ByocSpec and creates a new ByocSpecResponse model (typed with ReadCapacityResponse), but never updates the BYOC response deserialization in index_model.py. The serverless path uses ServerlessSpecResponse and manually deserializes nested read_capacity to work around "broken oneOf matching logic" in deserialize_model. The BYOC path still uses the request model ByocSpec (typed with ReadCapacity, not ReadCapacityResponse) and has no manual read_capacity handling. When a BYOC index with DRN is described or listed, read_capacity in the API response will likely fail to deserialize correctly.


Problem
When the Python client was released for
2025-10, the spec did not yet includeBYOCSpec.read_capacity, so the ability to configure BYOC indexes with DRN is limited through the SDK.Additionally, I noticed we never pulled in
BYOCSpec.schemaeither, so that can be added in as well.Solution
2025-10spec to pull in most recent changes (make generate-oas). We shouldn't need to regenerate grpc for this as the changes are limited toBYOCSpecin the control plane.schemaandread_capacitytoBYOCSpec, and make sure things are wired properly inrequest_factory.py.BackupModelSchemato useMetadataSchema. This was due to an error in the spec wherein theMetadataSchemain the OpenAPI spec did not have anx-component-name. That was fixed here: https://github.com/pinecone-io/apis/pull/417. It's confusing to haveBackupModelSchemaused in all these areas that aren't backup-related.Also pulled in some dependency bumps based on dependabot alerts:
aiohttp(2.6.3)urllib3(3.13.3)filelock(3.21.0)virtualenv(20.31.1)Type of Change
Test Plan
CI - unit, integration, etc
Note
Medium Risk
Touches generated API models and request-building for index creation/configuration; type/model renames and new BYOC fields could cause subtle compatibility or serialization issues if downstream code relies on the old schema types.
Overview
Regenerates the OpenAPI client from the
2025-10spec (and bumps the codegen target inMakefile), updating the embedded API repo SHA and refreshing generated docs/comments.Adds BYOC parity with serverless for index configuration by supporting
read_capacityandschemaonByocSpecand wiring both throughPineconeDBControlRequestFactory(including shared__parse_schemahandling for both direct field maps and{fields: ...}wrapper format).Renames the OpenAPI model used for metadata indexing configuration from
BackupModelSchema/BackupModelSchemaFieldstoMetadataSchema/MetadataSchemaFieldsacross control-plane models and public SDK type hints, adds a generatedByocSpecResponsemodel, and updates unit tests to cover schema parsing and BYOC/serverless spec variants. Also includes dependency lockfile updates (e.g.,aiohttp,urllib3,filelock,virtualenv) and a Ruff config tweak.Written by Cursor Bugbot for commit 6525664. This will update automatically on new commits. Configure here.