Remove SDK Defaults for Namespace Parameter #546
Merged
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
Removes SDK-imposed default values for the
namespaceparameter 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
pinecone/grpc/resources/vector_grpc.py: Changedupsert_from_dataframemethod signature fromnamespace: str = ""tonamespace: Optional[str] = Nonepinecone/grpc/index_grpc.py: Changedupsert_from_dataframemethod signature fromnamespace: str = ""tonamespace: Optional[str] = NoneBehavior Verification
Optional[str] = Nonefor namespace parametersnamespace=None: Parameter is omitted from request bodies (viaparse_non_empty_args), allowing the API to apply its defaultnamespace="": Parameter is included as empty string in request (explicit user choice, passed through unmodified)namespace="some_namespace": Parameter is included in request as expectedImpact
upsert_from_dataframemethods: Now default toNoneinstead of"", allowing the API to handle namespace defaults"__default__") without SDK interferenceRationale
The API is moving toward
"__default__"as the default namespace value. By removing SDK-imposed defaults (empty string), we ensure:Testing
namespace=Noneomits the parameter from requestsnamespace=""passes through as empty stringFiles Changed
pinecone/grpc/resources/vector_grpc.pypinecone/grpc/index_grpc.py