Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Nov 16, 2025

Summary

Removes SDK-imposed default values for the namespace parameter in GRPC methods, ensuring the SDK doesn't override API defaults. This change allows the API to handle namespace defaults appropriately as it moves toward "__default__" as the default namespace value.

Changes

GRPC Method Updates

  • Updated pinecone/grpc/resources/vector_grpc.py: Changed upsert_from_dataframe method signature from namespace: str = "" to namespace: Optional[str] = None
  • Updated pinecone/grpc/index_grpc.py: Changed upsert_from_dataframe method signature from namespace: str = "" to namespace: Optional[str] = None

Behavior Verification

  • All REST API methods already correctly use Optional[str] = None for namespace parameters
  • When namespace=None: Parameter is omitted from request bodies (via parse_non_empty_args), allowing the API to apply its default
  • When namespace="": Parameter is included as empty string in request (explicit user choice, passed through unmodified)
  • When namespace="some_namespace": Parameter is included in request as expected

Impact

  • GRPC upsert_from_dataframe methods: Now default to None instead of "", allowing the API to handle namespace defaults
  • Backward compatibility: No breaking changes - methods still accept all the same values, but default behavior now defers to the API
  • API flexibility: The API can now apply its own default namespace handling (e.g., "__default__") without SDK interference

Rationale

The API is moving toward "__default__" as the default namespace value. By removing SDK-imposed defaults (empty string), we ensure:

  • The SDK doesn't override API defaults
  • When users don't specify a namespace, the API can apply its own default handling
  • Explicit empty string values from users are still passed through as intended
  • The SDK remains neutral regarding namespace defaults, allowing the API to evolve its default behavior

Testing

  • All db data integration tests pass (104 passed, 18 skipped)
  • Verified that namespace=None omits the parameter from requests
  • Verified that namespace="" passes through as empty string
  • Verified that explicit namespace values work correctly

Files Changed

  • pinecone/grpc/resources/vector_grpc.py
  • pinecone/grpc/index_grpc.py

@jhamon jhamon marked this pull request as ready for review November 17, 2025 13:23
@jhamon jhamon merged commit 324c963 into release-candidate/2025-10 Nov 17, 2025
27 checks passed
@jhamon jhamon deleted the jhamon/remove-default-namespaces branch November 17, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants