Include sourceTag
in PineconeConfigurationSchema
#215
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.
Problem
When
sourceTag
was added toPineconeConfiguration
as an argument it was not included in thePineconeConfigurationSchema
object. This object is used bytypebox
at runtime to validate the arguments passed to the constructor. SincesourceTag
is not included, andPineconeConfigurationSchema
hasadditionalProperties: false
configured, users will see an error when trying to passsourceTag
:PineconeArgumentError: The client configuration had validation errors: argument must NOT have additional properties.
This can be disabled with the
PINECONE_DISABLE_RUNTIME_VALIDATIONS
environment variable, but that should not be required.Solution
Add
sourceTag
toPineconeConfigurationSchema
. Update the unit test that validates passing the additional parameters to the Pinecone constructor.We probably need some better integration / unit test coverage for some of the headers and config values that we're expecting to be sent on request. I can follow up with that. For now I tested locally with
PINECONE_DEBUG
andPINECONE_DEBUG_CURL
to verify the request:Type of Change
Test Plan
You can pull this branch down and run the repl locally. Basically, just confirm you can pass
sourceTag
as an argument toPinecone
and then make some network calls to check it shows up as you'd expect (see example screenshot above):