Skip to content

fix(chroma): use explicit None checks in _convertFilter#373

Open
kgarg2468 wants to merge 1 commit intorocketride-org:developfrom
kgarg2468:bugfix/chroma-filter-explicit-none
Open

fix(chroma): use explicit None checks in _convertFilter#373
kgarg2468 wants to merge 1 commit intorocketride-org:developfrom
kgarg2468:bugfix/chroma-filter-explicit-none

Conversation

@kgarg2468
Copy link
Contributor

@kgarg2468 kgarg2468 commented Mar 22, 2026

Summary

  • Fix Chroma _convertFilter so explicit empty lists and empty nodeId are not dropped by Python truthiness, matching other vector store implementations.

Bug

  • if docFilter.objectIds: (and similar) skipped filters when the value was [] or nodeId was '', producing no constraint instead of the intended narrow filter.

Steps to Reproduce

  1. Call Store._convertFilter with a DocFilter-like object with objectIds=[] or nodeId=''.
  2. Before: filter omits those clauses (often None). After: {'objectId': {'$in': []}} or {'nodeId': {'$eq': ''}} as appropriate.
.venv/bin/pytest nodes/test/test_chroma_convert_filter_explicit_none.py -v

Root Cause

  • Truthiness checks on fields that can be legitimately empty ([], '') caused those branches to be skipped.

Fix

Why This Works

  • Distinguishes "field not provided" (None) from "provided but empty" ([] / ''), consistent with e.g. Qdrant _convertFilter in the same codebase.

Testing / Validation

  • Added nodes/test/test_chroma_convert_filter_explicit_none.py.
  • pytest nodes/test/test_chroma_convert_filter_explicit_none.py → 4 passed locally.
  • ./builder test not run locally (CMake 4.x blocked full pipeline on this machine); CI expected per .github/workflows/ci.yml.

Type

fix

Checklist

  • Tests added or updated
  • Tested locally
  • ./builder test passes (blocked locally: CMake version; rely on CI)
  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Wiki updated (if applicable)
  • Breaking changes documented (if applicable)

Related Issues

List fields and optional scalars now use is not None so empty lists and empty nodeId are not dropped by Python truthiness, matching Milvus/Qdrant/Elasticsearch filter builders.

Tests: nodes/test/test_chroma_convert_filter_explicit_none.py
Made-with: Cursor
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Warning

Rate limit exceeded

@kgarg2468 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 881d7346-e271-4749-ad04-b588460d38c8

📥 Commits

Reviewing files that changed from the base of the PR and between f11c60c and ce25618.

📒 Files selected for processing (2)
  • nodes/src/nodes/chroma/chroma.py
  • nodes/test/test_chroma_convert_filter_explicit_none.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@asclearuc
Copy link
Collaborator

Looks like this one is more comprehensive than #325
And #325 needs to be closed in favor of this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:nodes Python pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants