diff --git a/chromadb/api/local.py b/chromadb/api/local.py index c64e91d426d..b10f2a5dcc8 100644 --- a/chromadb/api/local.py +++ b/chromadb/api/local.py @@ -152,12 +152,12 @@ def _get( offset=None, page=None, page_size=None, - where_document=None + where_document=None, ): if where is None: where = {} - + if where_document is None: where_document = {} @@ -182,7 +182,12 @@ def _delete(self, collection_name, ids=None, where=None, where_document=None): if where is None: where = {} - deleted_uuids = self._db.delete(collection_name=collection_name, where=where, ids=ids, where_document=where_document) + if where_document is None: + where_document = {} + + deleted_uuids = self._db.delete( + collection_name=collection_name, where=where, ids=ids, where_document=where_document + ) return deleted_uuids def _count(self, collection_name): diff --git a/chromadb/test/test_api.py b/chromadb/test/test_api.py index bad50fb5508..7354662c3d0 100644 --- a/chromadb/test/test_api.py +++ b/chromadb/test/test_api.py @@ -233,11 +233,8 @@ def test_delete(api_fixture, request): collection.add(**batch_records) assert collection.count() == 2 - # generic delete on collection not working yet - # assert collection.delete() == [] - # assert collection.count() == 2 - # assert collection.delete() - # assert collection.count() == 0 + collection.delete() + assert collection.count() == 0 @pytest.mark.parametrize("api_fixture", test_apis)