Repository navigation
test: add API version management tests - #581
Merged
Merged
Conversation
Verify that: - Each generated module has the correct API_VERSION constant - db_control, db_data → 2026-01.alpha (for FTS) - inference, oauth, admin → 2025-10 (stable) - setup_openapi_client correctly sets X-Pinecone-API-Version header - Index, Inference, Admin classes import correct versions - gRPC client uses shared API_VERSION Closes SDK-100
jhamon
marked this pull request as ready for review
January 28, 2026 17:37
jhamon
deleted the
jhamon/sdk-100-api-version-management-infrastructure
branch
January 28, 2026 17:37
jhamon
added a commit
that referenced
this pull request
Oct 23, 2026
…-to guides (#795) * gnhf 1: Fixed #581: I removed both links to the private, closed issue #250 from the restore-job warnings in docs/how-to/indexes/backups-and-restore.md and kept the warning prose. Commit as `docs(indexes): drop private issue links from restore-job warnings` with `Fixes #581`. * gnhf 2: I corrected the six #615 property examples (backups, backup_schedules, restore_jobs on Pinecone and AsyncPinecone) so each one reads every page instead of one. Commit as `docs(client): walk every page in backup, schedule and restore-job property examples` with `Refs #615`. * gnhf 3: I fixed the five strict cross-reference problems (a-e) owned by this area. Commit as `docs(client): qualify ambiguous and private cross-references in control-plane docstrings`. * gnhf 4: I added the #650 Raises line ':exc:`PineconeTypeError`: If *param* is not a ``str``.' to 25 control-plane methods in both the sync and async versions (indexes, backups, backup schedules, collections, restore jobs, inference model lookup, create_index_from_backup). Commit as `docs(client): document PineconeTypeError for non-str names and IDs in control-plane methods` with `Refs #650`. * gnhf 5: I did an accuracy and concision pass on docs/how-to/indexes/backups-and-restore.md, checking its claims against the SDK code and svc-global-apis. The page went from 511 lines to about 335; backend internals and validation specifics are gone, and every user-actionable caution is kept. Commit as `docs(indexes): tighten and verify the backups and restore how-to`. * gnhf 6: I did an accuracy and concision pass on docs/how-to/collections.md and the Collections/AsyncCollections docstrings, checking claims against svc-global-apis and pc-cps, and fixed a wrong claim about deleting a collection's source index. Commit as `docs(collections): correct source-index deletion rule and tighten the collections how-to`. * gnhf 7: I did an accuracy and concision pass on docs/how-to/inference/embeddings.md, checking its claims against the SDK code and svc-global-apis, fixed a wrong claim about which ModelInfo fields are None on a reranking model, and moved the storage example to a schema-based document index. Commit as `docs(inference): verify and tighten the embeddings how-to`. * gnhf 8: I did an accuracy and concision pass on docs/how-to/inference/reranking.md, checking its claims against the SDK code and the inference-server rerank handler; the two-stage pipeline example now uses a schema-based document index instead of the legacy index.query path. Commit as `docs(inference): verify and tighten the reranking how-to`. * gnhf 9: I did an accuracy and concision pass on docs/how-to/indexes/pod.md, checking it against the SDK code and svc-global-apis. That fixed a wrong claim about deleting a pod index, removed a stale verbatim server error and some irrelevant specifics, and cut the page from 179 to about 125 lines. Commit as `docs(indexes): verify and tighten the pod-based indexes how-to`. * gnhf 10: I did an accuracy and concision pass on docs/how-to/indexes/serverless.md, checking it against the SDK code and svc-global-apis, and fixed a wrong claim that idx.dimension and idx.metric are gone. Commit as `docs(indexes): verify and tighten the serverless indexes how-to`. * gnhf 11: I did an accuracy and concision pass on the inference docstrings: Inference and AsyncInference, the inference response models (ModelInfo, RerankResult, RankedDocument, EmbeddingsList, SparseEmbedding) and the model list. I fixed ModelInfo's wrong claim about which fields are embed-only and moved the embed storage example to a document index; every check passed. Commit as `docs(inference): verify and tighten the inference docstrings`. * gnhf 12: I did an accuracy and concision pass on the Backups/AsyncBackups and RestoreJobs/AsyncRestoreJobs docstrings and the BackupModel/RestoreJobModel attributes, and fixed a wrong failed-backup status: the server reports "InitializationFailed", not "Failed". All checks passed. Commit as `docs(backups): verify and tighten the backups and restore-job docstrings`. * gnhf 13: I did a verified accuracy and concision pass on BackupSchedules/AsyncBackupSchedules and the schedule models, and corrected three server-behavior claims: history rows on 2026-07 never report "Scheduled", re-enabling does not start a backup immediately, and the long-name failure warning was unsupported. Commit as `docs(backups): verify and tighten the backup-schedule docstrings`. * gnhf 14: I did an accuracy and concision pass on the Indexes/AsyncIndexes docstrings. It removed stale limits and specifics, merged the duplicate PineconeTypeError entry in configure, removed every em dash from docstring prose, and linked the legacy Records API methods with roles. Every check passed. Commit as `docs(indexes): verify and tighten the Indexes and AsyncIndexes docstrings`. * no-mistakes(review): Narrow backup-schedule negative docstring check to removed claim * no-mistakes(document): Drop stale immediate-backup claim from migration guide * docs: scope the collection restore claim by API version Earlier API versions restore a collection by creating a new pod index from it; 2026-07 rejects that, and this SDK raises before sending source_collection on any version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive unit tests to verify the API version management infrastructure works correctly across all API categories.
Closes SDK-100
Background
After reviewing the codebase, the API version management infrastructure is already in place:
db_control,db_data,inference,oauth,admin) has its ownAPI_VERSIONconstantsetup_openapi_client()correctly sets theX-Pinecone-API-VersionheaderThis PR adds tests to verify this infrastructure continues to work correctly.
Test Coverage
The new tests verify:
Module API versions - Each generated module has the correct version:
db_control,db_data→2026-01.alpha(for FTS support)inference,oauth,admin→2025-10(stable)Header setting -
setup_openapi_client()correctly sets/omits the version headerClient imports - Index, Inference, and Admin classes import the correct API versions
gRPC compatibility - gRPC uses the shared
API_VERSIONfromopenapi_supportTest Results
Note
Low Risk
Low risk: adds unit tests only, but they hard-code version strings and could become brittle when API versions roll.
Overview
Adds a new unit test suite (
tests/unit/utils/test_api_version_management.py) to enforce API version selection across SDK surfaces.The tests assert each generated OpenAPI module exposes the expected
API_VERSION(alpha fordb_control/db_data, stable forinference/oauth/admin), verifysetup_openapi_client()sets/omits theX-Pinecone-API-Versionheader based on theapi_versionargument, and confirm key wrappers (Index/Inference/Admin) plus the shared gRPCopenapi_support.api_version.API_VERSIONreference the expected version.Written by Cursor Bugbot for commit 3983f3c. This will update automatically on new commits. Configure here.