fix: ChromaUris was shadowed by a 'metadata' class, so every uris write raised - #5
Merged
Merged
Conversation
base.py defined `ChromaUris` twice; the second (codec field "metadata", which is not a chromadb kwarg) replaced the first, so every ChromaUris write/append raised TypeError. #3's test covered "ChromaUris" only through a fake that accepts any kwarg, so it passed. The second class is now `ChromaMetadatas` on the real "metadatas" field, with no `append` since chromadb refuses an upsert that has metadata but no documents. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 22, 2026
thorwhalen
added a commit
that referenced
this pull request
Sep 22, 2026
) Post-merge review of #5, against chromadb 1.5.9. - Writes: upsert embeds only documents or images, so an upsert carrying only uris raises "Exactly one of documents, images must be provided", even with a data_loader. Only add embeds uris through the data loader. ChromaUris now adds new keys, and replaces existing ones (delete + add, keeping metadata as upsert would). If the add fails, it restores the old record. - Reads: a default collection.get leaves uris out, so ChromaUris[k] was always None. ChromaCollection gains a get_include seam; ChromaUris sets it to ("uris",). - The recording fake also records add and filters get by id. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Member
Author
|
Post-merge review against a real chromadb 1.5.9: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-merge refute review of #3.
Defect
chromadol/base.pydefinesclass ChromaUristwice. #3 reordered both decorator stacks but left them as they were otherwise. The second definition wins and is asingle_nested_value("metadata")codec, andmetadatais not achromadbkwarg. So on master:#3's
test_append_writes_what_setitem_writes[ChromaUris]passes only because_RecordingCollection.upsertaccepts any kwarg, so it compares two equally wrong calls.Fix
ChromaUrisis now the oneurisstore again. Its docstring says a collection with adata_loaderis needed, becausechromadbrefuses uris otherwise.ChromaMetadatason the realmetadatasfield. It has noappend:chromadbrefuses an upsert with neither documents nor images ("Exactly one of documents, images must be provided"), so an auto-keyed metadata-only append can never succeed. It works as a read view.fleet_dependents.jsonlists no importers of chromadol.Tests
test_single_field_stores_write_their_own_chromadb_field(documents/uris/metadatas) asserts the exact kwarg each store sends. On masterChromaUrissendsmetadata.test_chroma_metadatas_reads_the_metadatas_fieldruns against a real PersistentClient.Self-reviewed only (the worker was told not to spawn a sub-agent reviewer). This needs a post-merge review.
🤖 Generated with Claude Code