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

Add has_index() #385

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Add has_index() #385

merged 4 commits into from
Aug 28, 2024

Conversation

rohanshah18
Copy link
Contributor

@rohanshah18 rohanshah18 commented Aug 16, 2024

Problem

Currently, users can not easily check if an index exists or not. The .names() iterator on the list_indexes response object is not super discoverable.

Solution

Add has_index() which internally calls describe_index() and returns true if the index exists, false otherwise.

Type of Change

  • New feature (non-breaking change which adds functionality)

Test Plan

Added integration tests.


Copy link
Collaborator

@jhamon jhamon left a comment

Choose a reason for hiding this comment

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

I left some feedback to fix, but overall great job putting together your first PR in python :)

pinecone/control/pinecone.py Outdated Show resolved Hide resolved
pinecone/control/pinecone.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jhamon jhamon left a comment

Choose a reason for hiding this comment

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

Looks great! 🚢

@rohanshah18 rohanshah18 merged commit 1d0b686 into main Aug 28, 2024
85 checks passed
@rohanshah18 rohanshah18 deleted the rshah/hasIndex branch August 28, 2024 16:22
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