Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] UniqueConstraintError not included as a ChromaError #3439

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions chromadb/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,7 @@ def name(cls) -> str:
"VersionMismatchError": VersionMismatchError,
"RateLimitError": RateLimitError,
"AuthError": ChromaAuthError,
"UniqueConstraintError": UniqueConstraintError,
"QuotaError": QuotaError,
"InternalError": InternalError,
}
3 changes: 2 additions & 1 deletion chromadb/test/api/test_collection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from chromadb.api import ClientAPI
from chromadb.errors import UniqueConstraintError


def test_duplicate_collection_create(
Expand All @@ -21,7 +22,7 @@ def test_duplicate_collection_create(
assert False, "Expected exception"
except Exception as e:
print("Collection creation failed as expected with error ", e)
assert "already exists" in e.args[0] or "UniqueConstraintError" in e.args[0]
assert "already exists" in e.args[0] or isinstance(e, UniqueConstraintError)


def test_not_existing_collection_delete(
Expand Down
Loading