-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[ENH] Embedding validation error message #5385
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Improve Embedding Validation Error Messages This PR updates the error handling in the embedding normalization logic, providing clearer and more consistent ValueError messages when embeddings validation fails. It ensures empty lists and empty nested lists within embeddings are specifically checked and produce informative, user-friendly feedback. Key Changes• Changed the Affected Areas• chromadb/api/types.py ( This summary was automatically generated by @propel-code-bot |
if len(target[0]) == 0: | ||
raise ValueError("Expected embeddings to be at least 1-dimensional") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
The error message contains an inconsistency with the existing codebase. Based on the related code from the database, this function should raise errors about empty embeddings, but the new validation check for empty nested lists uses different wording than the existing pattern.
The existing validation functions use more specific error messages like:
"Expected each embedding in the embeddings to be a 1-dimensional numpy array with at least 1 int/float value. Got a 1-dimensional numpy array with no values at pos {i}"
Consider making the error message more specific and consistent:
if len(target[0]) == 0: | |
raise ValueError("Expected embeddings to be at least 1-dimensional") | |
raise ValueError(f"Expected each embedding to be non-empty, got empty embedding at position 0") |
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
54b888f
to
adf844d
Compare
2 Jobs Failed: PR checks / all-required-pr-checks-passedStep "Decide whether the needed jobs succeeded or failed" from job "all-required-pr-checks-passed" is failing. The last 20 log lines are:
PR checks / Go tests / cluster-testStep "Run bin/cluster-test.sh bash -c 'cd go && make test'" from job "Go tests / cluster-test" is failing. The last 20 log lines are:
Summary: 1 successful workflow, 1 failed workflow
Last updated: 2025-09-04 21:50:09 UTC |
closes #5047