Skip to content

Allow embed as a parameter to configureIndex #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

austin-denoble
Copy link
Contributor

Problem

Currently, the ConfigureIndexRequest interface supports embed?: ConfigureIndexRequestEmbed as a parameter, which aligns with the OAS spec and how the endpoint can be used:

However, the embed field was not added to ConfigureIndexRequestProperties, defining what we expect a user to provide in a request. We also error out if the user attempts to configure an index with just the embed property.

Solution

Update ConfigureIndexRequestProperties and the validation logic in the configureIndex action to allow leveraging embed properly.

Type of Change\

  • 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

CI Unit & Integration Tests

Copy link

@rohanshah18 rohanshah18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -37,7 +37,7 @@ describe('configureIndex argument validations', () => {

await expect(toThrow).rejects.toThrowError(PineconeArgumentError);
await expect(toThrow).rejects.toThrowError(
'Object contained invalid properties: speculoos. Valid properties include deletionProtection, spec, tags.'
'Object contained invalid properties: speculoos. Valid properties include deletionProtection, spec, tags, embed.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

speculoos? lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's the invalid object key which ends up in the error message.

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.

3 participants