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

[Bug] Cannot create an index from a source collection in v3 #294

Closed
2 tasks done
jacob-petterle opened this issue Jan 21, 2024 · 1 comment
Closed
2 tasks done

[Bug] Cannot create an index from a source collection in v3 #294

jacob-petterle opened this issue Jan 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jacob-petterle
Copy link

Is this a new bug in the Pinecone Python client?

  • I believe this is a new bug in the Pinecone Python Client
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

In pinecone v3, neither the ServerlessSpec or the PodSpec allow creating indexes from a source collection even though the docs show that this is possible:
https://docs.pinecone.io/docs/manage-indexes#create-an-index-from-a-collection

Expected Behavior

Be able to create both serverless and pod specs from collections

Steps To Reproduce

  1. Create a Pinecone instance
  2. Using, pinecone.create_index(), attempt to create either a pod or serverless based index

Relevant log output

NA

Environment

NA

Additional Context

Link to docs

Link to source code that mismatches

@jacob-petterle jacob-petterle added the bug Something isn't working label Jan 21, 2024
@daverigby
Copy link
Contributor

This is now possible as of v3.0.2 of the SDK:

Create indexes using source_collection option in PodSpec

This release resolves a bug when passing source_collection as part of the PodSpec. This option is used when creating a new index from vector data stored in a collection. The value of this field should be a collection you have created previously from an index and that shows with pc.list_collections(). Currently collections and pod-based indexes are not portable across environments.

from pinecone import Pinecone
pc = Pinecone(api_key='YOUR_API_KEY')

pc.create_index(
  name='my-index', 
  dimension=1536, 
  metric='cosine', 
  spec=PodSpec(
      environment='us-east1-gcp', 
      source_collection='collection-2024jan16',
  )
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants