Skip to content

feat(v2): implement metadata Where DSL operators - #120

Merged
oss-amikos merged 1 commit into
mainfrom
codex/issue-119-where-dsl
Mar 1, 2026
Merged

feat(v2): implement metadata Where DSL operators#120
oss-amikos merged 1 commit into
mainfrom
codex/issue-119-where-dsl

Conversation

@oss-amikos

@oss-amikos oss-amikos commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • implement typed metadata Where operators (eq/ne/gt/gte/lt/lte/in/nin) and metadata array operators (contains/notContains)
  • align validation/serialization behavior with chroma-go while protecting Java callers with early client-side guards
    • reject reserved metadata key prefixes (#, $)
    • reject whitespace-only metadata keys
    • reject non-finite float values (NaN, Infinity)
    • preserve metadata string whitespace semantics for eq/ne/in/nin and enforce non-empty strings for contains/notContains
  • keep interop with existing inline ID/document filters and logical combinators (and/or), including one-clause compatibility note
  • expand unit/integration coverage for serialization, validation, immutability, nested composition, and get/query/delete metadata filters

Testing

  • mvn clean -Dtest=WhereTest,ChromaHttpCollectionTest,RecordOperationsIntegrationTest test

Fixes #119

@oss-amikos
oss-amikos requested a review from tazarov as a code owner March 1, 2026 17:06
@propel-code-bot

Copy link
Copy Markdown

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.
• Metadata string set operations allow empty string elements; confirm this aligns with server expectations.

This summary was automatically generated by @propel-code-bot

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Where operators (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.

@oss-amikos
oss-amikos merged commit a3f2e6a into main Mar 1, 2026
9 checks passed
@oss-amikos
oss-amikos deleted the codex/issue-119-where-dsl branch March 1, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: Implement type-safe metadata Where DSL operators

2 participants