-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implement optional index tags in create_index
and configure_index
#426
base: release-candidate/2025-01
Are you sure you want to change the base?
Conversation
create_index
and configure_index
b67293b
to
57cfac0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
only nit is we may want to include a minimal amount of documentation about needing to use ""
to delete / clear a tag
@@ -280,17 +288,31 @@ def configure_index( | |||
replicas: Optional[int] = None, | |||
pod_type: Optional[str] = None, | |||
deletion_protection: Optional[Literal["enabled", "disabled"]] = None, | |||
tags: Optional[Dict[str, str]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Should the docstring in the interface be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks.
This might be an unnecessary question, but why do you have to merge existing tags? At least when I hit this endpoint in Node, existing tags are already merged (i.e. a configure req (containing a new tag) that is sent to an index w/existing tags already merges the new and existing tags). Previous to this PR, were tags being overwritten when updated when you hit this endpoint in Python? |
): | ||
"""This method is used to scale configuration fields for your pod-based Pinecone index. | ||
|
||
:param: name: the name of the Index | ||
:param: replicas: the desired number of replicas, lowest value is 0. | ||
:param: pod_type: the new pod_type for the index. To learn more about the | ||
available pod types, please see [Understanding Indexes](https://docs.pinecone.io/docs/indexes) | ||
|
||
:param: deletion_protection: If set to 'enabled', the index cannot be deleted. If 'disabled', the index can be deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd add that enabled
is the default here.
Problem
Want to expose kwargs for setting and modifying index tags
Solution
The usual. The generated bits backing this feature already got created when I generated off the
2025-01
spec.I added a small amount of logic to handle merging new and existing tags when using configure.
Usage
Type of Change