pinecone-io / pinecone-datasets

An open-source dataset library for pre-embedded dataset: create your own data catalog, or use Pinecone's public datasets.
https://pinecone-io.github.io/pinecone-datasets/
32 stars 12 forks source link

Bug fix - wrong behaviour for should_create_index #25

Open igiloh-pinecone opened 1 year ago

igiloh-pinecone commented 1 year ago

Problem

The should_create_index was implemented like do_create_index instead of behaving like allow_existing_index, which is the original purpose.
When the user is setting should_create_index=False, he doesn't necessarily mean "don't create index", but rather "create index of you need to, but I allow upserting to existing one".

This behavior blocks other libraries that rely on pinecone-datasets to implicitly create the index if\when needed, like pinecone-context.

Solution

Altered the behavior to match intended design.

Type of Change

Test Plan

Already covered by existing tests