Repository navigation
Prevent _get_api_instance from modifying OpenAPI config - #221
Merged
Merged
Conversation
…assing it into the IndexOperationsApi
austin-denoble
commented
Oct 17, 2023
|
|
||
| def _get_api_instance(): | ||
| client_config = Config.OPENAPI_CONFIG | ||
| client_config = copy.deepcopy(Config.OPENAPI_CONFIG) |
Member
Author
There was a problem hiding this comment.
This is what we're doing in index.py, I think it's probably prudent to do that here as well rather than possibly changing fields on the singleton.
jhamon
approved these changes
Oct 17, 2023
NishchayMahor
pushed a commit
to NishchayMahor/python-sdk-1
that referenced
this pull request
Sep 22, 2026
…inecone-io#127) (pinecone-io#221) * feat(assistant)!: 2026-07 chat/chat_completions/context conformance (pinecone-io#127) Claim the three assistant_data chat operations for the 2026-07 conformance suite and align the sync chat surface with the spec's enum churn. The spec's assistant_data servers url has no path component, but the data plane is mounted under /assistant — the backend builds its own Location headers that way and the SDK has always sent that prefix. Rather than relax the path assertion, the divergence list grows a base_path_overrides section under the same no-silent-exceptions contract as response-schema divergences: question issue by number plus a reason, folded into the manifest per operation, with what the spec declares kept visible in spec_base_path and the referenced issue checked by --gate. StreamMessageEnd gains finish_reason, which the OAS marks required on MessageEndModel and the SDK silently dropped, and FileReference gains type, which every TypedReferenceModel variant requires and without which a spec-conformant context fixture cannot round-trip. Model names: docstrings now list the per-endpoint 2026-07 sets. The backend still accepts claude-3-5-sonnet/claude-3-7-sonnet as deprecated aliases remapped to claude-sonnet-4-5, and accepts gpt-5 on chat_completions although the spec omits it there — both recorded on pinecone-io#220 and documented backend-first rather than promised as rejections. * test(conformance): cover the base_path_overrides loader and its manifest fold-in
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.
Problem
Previous revision we added some code to apply a custom
hostvalue to control plane operations: #218This change caused 404s when calling dataplane operations. The
Configuration._base_pathvalue was being overwritten by the customhostthat was provided due to theConfiguration.hostsetter:https://github.com/pinecone-io/pinecone-python-client/blob/7ff4ed877ac3e97eb557b747a072a84e57764b91/pinecone/core/client/configuration.py#L493
Solution
The change I made was actually modifying the reference to
Config.OPENAPI_CONFIGwhich overwrote things across the board.Instead of operating on the singleton's instance of the config, we can use
copy.deepcopy(Config.OPENAPI_CONFIG)and use that to construct things before handing it off toApiClientType of Change
Test Plan
Pull this branch down, use the client locally and make sure that dataplane calls work properly without a
hostor with one in the case of supplying a custom control plane URL.