Skip to content

Commit

Permalink
No empty filters
Browse files Browse the repository at this point in the history
  • Loading branch information
atroyn committed Oct 11, 2024
1 parent 1bd9295 commit 9d25975
Show file tree
Hide file tree
Showing 18 changed files with 849 additions and 645 deletions.
8 changes: 4 additions & 4 deletions chromadb/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ def _delete(
self,
collection_id: UUID,
ids: Optional[IDs],
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
) -> None:
"""[Internal] Deletes entries from a collection specified by UUID.
Expand All @@ -274,8 +274,8 @@ def _query(
collection_id: UUID,
query_embeddings: Embeddings,
n_results: int = 10,
where: Where = {},
where_document: WhereDocument = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
include: Include = IncludeMetadataDocumentsEmbeddingsDistances,
) -> QueryResult:
"""[Internal] Performs a nearest neighbors query on a collection specified by UUID.
Expand Down
12 changes: 6 additions & 6 deletions chromadb/api/async_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ async def _get(
self,
collection_id: UUID,
ids: Optional[IDs] = None,
where: Optional[Where] = {},
where: Optional[Where] = None,
sort: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
where_document: Optional[WhereDocument] = {},
where_document: Optional[WhereDocument] = None,
include: Include = ["embeddings", "metadatas", "documents"], # type: ignore[list-item]
) -> GetResult:
"""[Internal] Returns entries from a collection specified by UUID.
Expand All @@ -243,8 +243,8 @@ async def _delete(
self,
collection_id: UUID,
ids: Optional[IDs],
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
) -> None:
"""[Internal] Deletes entries from a collection specified by UUID.
Expand All @@ -265,8 +265,8 @@ async def _query(
collection_id: UUID,
query_embeddings: Embeddings,
n_results: int = 10,
where: Where = {},
where_document: WhereDocument = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
include: Include = ["embeddings", "metadatas", "documents", "distances"], # type: ignore[list-item]
) -> QueryResult:
"""[Internal] Performs a nearest neighbors query on a collection specified by UUID.
Expand Down
12 changes: 6 additions & 6 deletions chromadb/api/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ async def _get(
self,
collection_id: UUID,
ids: Optional[IDs] = None,
where: Optional[Where] = {},
where: Optional[Where] = None,
sort: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
where_document: Optional[WhereDocument] = {},
where_document: Optional[WhereDocument] = None,
include: Include = ["embeddings", "metadatas", "documents"], # type: ignore[list-item]
) -> GetResult:
return await self._server._get(
Expand All @@ -354,8 +354,8 @@ async def _delete(
self,
collection_id: UUID,
ids: Optional[IDs],
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
) -> None:
await self._server._delete(
collection_id=collection_id,
Expand All @@ -370,8 +370,8 @@ async def _query(
collection_id: UUID,
query_embeddings: Embeddings,
n_results: int = 10,
where: Where = {},
where_document: WhereDocument = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
include: Include = ["embeddings", "metadatas", "documents", "distances"], # type: ignore[list-item]
) -> QueryResult:
return await self._server._query(
Expand Down
8 changes: 4 additions & 4 deletions chromadb/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ def _delete(
self,
collection_id: UUID,
ids: Optional[IDs],
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
) -> None:
self._server._delete(
collection_id=collection_id,
Expand All @@ -322,8 +322,8 @@ def _query(
collection_id: UUID,
query_embeddings: Embeddings,
n_results: int = 10,
where: Where = {},
where_document: WhereDocument = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
include: Include = ["embeddings", "metadatas", "documents", "distances"], # type: ignore[list-item]
) -> QueryResult:
return self._server._query(
Expand Down
4 changes: 2 additions & 2 deletions chromadb/api/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ def _delete(
self,
collection_id: UUID,
ids: Optional[IDs] = None,
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
) -> None:
"""Deletes embeddings from the database"""
self._make_request(
Expand Down
Loading

0 comments on commit 9d25975

Please sign in to comment.