When sourceTag was added to PineconeConfiguration as an argument it was not included in the PineconeConfigurationSchema object. This object is used by typebox at runtime to validate the arguments passed to the constructor. Since sourceTag is not included, and PineconeConfigurationSchema has additionalProperties: false configured, users will see an error when trying to pass sourceTag:
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 to PineconeConfigurationSchema. 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 and PINECONE_DEBUG_CURL to verify the request:
Type of Change
[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
[ ] Infrastructure change (CI configs, etc)
[ ] Non-code change (docs, etc)
[ ] None of the above: (explain here)
Test Plan
You can pull this branch down and run the repl locally. Basically, just confirm you can pass sourceTag as an argument to Pinecone and then make some network calls to check it shows up as you'd expect (see example screenshot above):
$ export PINECONE_DEBUG=true
$ export PINECONE_DEBUG_CURL=true
$ npm run repl
$ await init()
const newClient = new Pinecone({ apiKey: "my-key", sourceTag: "my-tag" })
await newClient.listIndexes()
// Validate the request has the expected user-agent shape
To see the specific tasks where the Asana app for GitHub is being used, see below:
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):