fix(chroma): use explicit None checks in _convertFilter#373
fix(chroma): use explicit None checks in _convertFilter#373kgarg2468 wants to merge 1 commit intorocketride-org:developfrom
Conversation
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
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
_convertFilterso explicit empty lists and emptynodeIdare not dropped by Python truthiness, matching other vector store implementations.Bug
if docFilter.objectIds:(and similar) skipped filters when the value was[]ornodeIdwas'', producing no constraint instead of the intended narrow filter.Steps to Reproduce
Store._convertFilterwith aDocFilter-like object withobjectIds=[]ornodeId=''.None). After:{'objectId': {'$in': []}}or{'nodeId': {'$eq': ''}}as appropriate.Root Cause
[],'') caused those branches to be skipped.Fix
is not NonefornodeId,parent,tableIds,permissions,objectIds, andchunkIdsinnodes/src/nodes/chroma/chroma.py.isTableis intentionally unchanged here to avoid duplicating fix(chroma): honor DocFilter.isTable=false in _convertFilter #325 (isTable=False); that PR addsis not NoneforisTable.Why This Works
None) from "provided but empty" ([]/''), consistent with e.g. Qdrant_convertFilterin the same codebase.Testing / Validation
nodes/test/test_chroma_convert_filter_explicit_none.py.pytest nodes/test/test_chroma_convert_filter_explicit_none.py→ 4 passed locally../builder testnot run locally (CMake 4.x blocked full pipeline on this machine); CI expected per.github/workflows/ci.yml.Type
fix
Checklist
./builder testpasses (blocked locally: CMake version; rely on CI)Related Issues
isTable=False; complementary, not duplicate)