Skip to content

Commit

Permalink
add tests for upsert and update with none ids
Browse files Browse the repository at this point in the history
  • Loading branch information
spikechroma committed Sep 11, 2024
1 parent b872676 commit bc71c6c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chromadb/test/api/test_api_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest
from chromadb.api import ClientAPI


def test_update_with_none_ids(client: ClientAPI) -> None:
client.reset()
collection = client.create_collection("test")
with pytest.raises(ValueError) as e:
collection.update(ids=None, embeddings=[[0.1, 0.2, 0.3]]) # type: ignore[arg-type]
assert "You must provide ids." in str(e)
10 changes: 10 additions & 0 deletions chromadb/test/api/test_api_upsert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest
from chromadb.api import ClientAPI


def test_upsert_with_none_ids(client: ClientAPI) -> None:
client.reset()
collection = client.create_collection("test")
with pytest.raises(ValueError) as e:
collection.upsert(ids=None, embeddings=[[0.1, 0.2, 0.3]]) # type: ignore[arg-type]
assert "You must provide ids." in str(e)

0 comments on commit bc71c6c

Please sign in to comment.