Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Jan 28, 2026

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:

  • Each generated module (db_control, db_data, inference, oauth, admin) has its own API_VERSION constant
  • Client classes import their module-specific version
  • setup_openapi_client() correctly sets the X-Pinecone-API-Version header

This PR adds tests to verify this infrastructure continues to work correctly.

Test Coverage

The new tests verify:

  1. Module API versions - Each generated module has the correct version:

    • db_control, db_data2026-01.alpha (for FTS support)
    • inference, oauth, admin2025-10 (stable)
  2. Header setting - setup_openapi_client() correctly sets/omits the version header

  3. Client imports - Index, Inference, and Admin classes import the correct API versions

  4. gRPC compatibility - gRPC uses the shared API_VERSION from openapi_support

Test Results

tests/unit/utils/test_api_version_management.py - 12 passed
tests/unit/utils/test_setup_openapi_client.py - 4 passed

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 for db_control/db_data, stable for inference/oauth/admin), verify setup_openapi_client() sets/omits the X-Pinecone-API-Version header based on the api_version argument, and confirm key wrappers (Index/Inference/Admin) plus the shared gRPC openapi_support.api_version.API_VERSION reference the expected version.

Written by Cursor Bugbot for commit 3983f3c. This will update automatically on new commits. Configure here.

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 jhamon added enhancement New feature or request python Pull requests that update Python code labels Jan 28, 2026
@jhamon jhamon marked this pull request as ready for review January 28, 2026 17:37
@jhamon jhamon merged commit 42dad99 into fts Jan 28, 2026
7 checks passed
@jhamon jhamon deleted the jhamon/sdk-100-api-version-management-infrastructure branch January 28, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants