feat(v2): implement metadata Where DSL operators - #120
Conversation
|
It also introduces a broader set of operator types in the Where DSL, including set inclusion/exclusion alongside array containment behaviors. Possible Issues• Single-clause logical combinators may not be accepted by all Chroma deployments despite client-side allowance. This summary was automatically generated by @propel-code-bot |
There was a problem hiding this comment.
Pull request overview
Implements the previously placeholder v2 Where metadata operator factories so Java callers can build type-safe metadata filters that serialize to Chroma’s where JSON shape, with added client-side validation/guards and expanded test coverage.
Changes:
- Implemented typed metadata
Whereoperators (eq/ne/gt/gte/lt/lte/in/nin) plus array metadata operators (contains/notContains) with validation (reserved key prefixes, whitespace-only keys, finite floats). - Updated logical combinators (
and/or) to accept a single clause (with compatibility note) and serialize accordingly. - Expanded unit + integration tests to cover serialization, validation, immutability, and get/query/delete usage with metadata filters.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/main/java/tech/amikos/chromadb/v2/Where.java |
Implements metadata operator factories, adds metadata key/value validation, and adjusts and/or validation to allow single-clause expressions. |
src/test/java/tech/amikos/chromadb/v2/WhereTest.java |
Replaces “not implemented” assertions with serialization/validation/immutability tests for new operators and single-clause combinators. |
src/test/java/tech/amikos/chromadb/v2/RecordOperationsIntegrationTest.java |
Adds integration coverage for metadata filters in get, query, and delete flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Whereoperators (eq/ne/gt/gte/lt/lte/in/nin) and metadata array operators (contains/notContains)chroma-gowhile protecting Java callers with early client-side guards#,$)NaN,Infinity)eq/ne/in/ninand enforce non-empty strings forcontains/notContainsand/or), including one-clause compatibility noteget/query/deletemetadata filtersTesting
mvn clean -Dtest=WhereTest,ChromaHttpCollectionTest,RecordOperationsIntegrationTest testFixes #119