-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from supabase/or/bugfix-lookup-indexes-by-table
Scope index lookups to a table to remove singleton ix issue
- Loading branch information
Showing
3 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import vecs | ||
|
||
|
||
def test_issue_90_multiple_index_support(client: vecs.Client) -> None: | ||
# Create a collection | ||
col1 = client.get_or_create_collection(name="col1", dimension=3) | ||
|
||
# Upsert some records | ||
col1.upsert( | ||
records=[ | ||
( | ||
"vec0", # the vector's identifier | ||
[0.1, 0.2, 0.3], # the vector. list or np.array | ||
{"year": 1973}, # associated metadata | ||
), | ||
("vec1", [0.7, 0.8, 0.9], {"year": 2012}), | ||
] | ||
) | ||
|
||
# Creat an index on the first collection | ||
col1.create_index() | ||
|
||
# Create a second collection | ||
col2 = client.get_or_create_collection(name="col2", dimension=3) | ||
|
||
# Create an index on the second collection | ||
col2.create_index() | ||
|
||
assert col1.index is not None | ||
assert col2.index is not None | ||
|
||
assert col1.index != col2.index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
) | ||
|
||
__project__ = "vecs" | ||
__version__ = "0.4.3" | ||
__version__ = "0.4.4" | ||
|
||
|
||
__all__ = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters