Skip to content
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

Update ConfigureIndex to merge new and previous IndexTags, update README examples #89

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

austin-denoble
Copy link
Contributor

Problem

@jhamon called out that since ConfigureIndex is a PATCH operation, we should probably be explicitly merging existing tags with incoming tags when configuring an index as a partial update. See here for a python example: https://github.com/pinecone-io/pinecone-python-client/pull/426/files#diff-9e7f01373e4589c7e4ded21935023cdf187ab6ce8b2b44a0d5470a27eaf464eeR303-R314

Solution

  • Update ConfigureIndex to call DescribeIndex and merge tags properly on updates.
  • Update README to add examples of using IndexTags when creating and updating indexes.

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

just test
Make sure CI is green.

…ex to call DescribeIndex and merge tags properly on updates
@@ -90,7 +90,6 @@ func (ts *IntegrationTests) TestDeleteVectorsByFilter() {

if ts.indexType == "serverless" {
assert.Error(ts.T(), err)
assert.Containsf(ts.T(), err.Error(), "Serverless and Starter indexes do not support deleting with metadata filtering", "Expected error message to contain 'Serverless and Starter indexes do not support deleting with metadata filtering'")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This error message has changed slightly since this test was originally written. I think it's fine to remove the string check for now and just validate that we've gotten an error back.

@@ -953,8 +960,7 @@ func (c *Client) ConfigureIndex(ctx context.Context, name string, in ConfigureIn
}
}
request.DeletionProtection = (*db_control.DeletionProtection)(deletionProtection)
request.Tags = (*db_control.IndexTags)(&in.Tags)
fmt.Printf("request.Tags: %+v\n", request.Tags)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops - left this in previously

@austin-denoble austin-denoble merged commit 5a7fff1 into main Dec 20, 2024
4 checks passed
@austin-denoble austin-denoble deleted the adenoble/update-readme-index-tags branch December 20, 2024 20:32
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.

2 participants