Skip to content

Commit

Permalink
add id validations
Browse files Browse the repository at this point in the history
  • Loading branch information
spikechroma committed Sep 11, 2024
1 parent cee4eab commit b872676
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chromadb/api/models/CollectionCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ def _process_upsert_request(
uris=uris,
)

if unpacked_record_set["ids"] is None:
raise ValueError("You must provide ids.")

self._validate_record_set(
unpacked_record_set,
require_data=True,
Expand Down Expand Up @@ -467,6 +470,9 @@ def _process_update_request(
uris=uris,
)

if unpacked_record_set["ids"] is None:
raise ValueError("You must provide ids.")

self._validate_record_set(
unpacked_record_set,
require_data=False,
Expand Down

0 comments on commit b872676

Please sign in to comment.