fix(store): honor _createCollection() return value before indexing#1559
Conversation
DocumentStoreBase.createCollection() discarded the bool returned by the provider-specific _createCollection(), so a driver that reported failure by returning False was ignored: the base proceeded to addChunks() against a collection that was never created, crashing cryptically (e.g. Chroma's "'NoneType' object has no attribute 'delete'") far from the real cause. Capture the return value and raise a clear error when it is exactly False, before indexing. `is False` is deliberate so drivers that return None on success (weaviate, vectordb_postgres) are unaffected; drivers that raise on failure (qdrant, pinecone) propagate their own error before the check. Milvus's _createCollection had inverted semantics (returned False on success, True on failure), which honoring the return value would otherwise break; it is corrected to the documented contract (return True on success, let real failures raise) in the same change. Fixes rocketride-org#1495
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
|
Caution Review failedFailed to post review comments. GitHub was unavailable or timed out while CodeRabbit was posting the review. Please request a new review later if the pull request still needs one. This happened while posting 1 inline comment. Use ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (.cursorrules)
Files:
nodes/**/*.py⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (26)📚 Learning: 2026-03-24T21:28:07.433ZApplied to files:
📚 Learning: 2026-03-25T16:11:50.206ZApplied to files:
📚 Learning: 2026-03-27T23:31:51.042ZApplied to files:
📚 Learning: 2026-03-30T21:57:11.296ZApplied to files:
📚 Learning: 2026-03-30T22:18:48.072ZApplied to files:
📚 Learning: 2026-04-02T13:09:51.916ZApplied to files:
📚 Learning: 2026-04-03T04:00:08.250ZApplied to files:
📚 Learning: 2026-04-03T05:20:16.219ZApplied to files:
📚 Learning: 2026-04-03T18:31:22.345ZApplied to files:
📚 Learning: 2026-04-03T18:31:20.227ZApplied to files:
📚 Learning: 2026-04-03T18:31:34.956ZApplied to files:
📚 Learning: 2026-04-08T07:11:59.835ZApplied to files:
📚 Learning: 2026-04-23T09:43:35.158ZApplied to files:
📚 Learning: 2026-05-18T11:51:47.483ZApplied to files:
📚 Learning: 2026-05-20T14:02:50.466ZApplied to files:
📚 Learning: 2026-06-13T07:37:27.809ZApplied to files:
📚 Learning: 2026-04-02T20:29:16.277ZApplied to files:
📚 Learning: 2026-06-05T22:02:43.464ZApplied to files:
📚 Learning: 2026-04-09T17:54:10.282ZApplied to files:
📚 Learning: 2026-04-15T00:13:11.455ZApplied to files:
📚 Learning: 2026-05-18T11:51:47.483ZApplied to files:
📚 Learning: 2026-05-20T14:18:46.136ZApplied to files:
📚 Learning: 2026-06-15T16:17:16.443ZApplied to files:
📚 Learning: 2026-04-02T20:34:40.920ZApplied to files:
📚 Learning: 2026-05-18T11:43:08.452ZApplied to files:
📚 Learning: 2026-06-01T21:15:35.971ZApplied to files:
📝 WalkthroughWalkthrough
ChangesCollection creation failure handling
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
DocumentStoreBase.createCollection() discarded the bool returned by the
provider-specific _createCollection(), so a driver that reported failure by
returning False was ignored: the base proceeded to addChunks() against a
collection that was never created, crashing cryptically (e.g. Chroma's
"'NoneType' object has no attribute 'delete'") far from the real cause.
Summary
DocumentStoreBase.createCollection()now captures_createCollection()'s return value and raises a clear error when it is exactlyFalse, before callingaddChunks().is Falseis deliberate — drivers that returnNoneon success (weaviate, vectordb_postgres) are unaffected, and drivers that raise on failure (qdrant, pinecone) propagate their own error before the check is reached.milvus._createCollectionhad inverted semantics (returnedFalseon success,Trueon failure), which honoring the return value would otherwise break. Corrected to the documented contract: returnTrueon success and let real failures raise (removing atry/exceptthat swallowed the real error).packages/ai/tests/ai/common/test_store.pycovering the raise-on-False, success, and exception-propagation paths.Scope is intentionally limited to #1495. Atlas's always-
Trueswallow and weaviate/postgres'sNone-return are separate defects that do not interact with this fix (theis Falsecheck leaves them working) and are left for follow-up issues.Type
fix
Testing
./builder testpasses./builder ai:testpasses fully (including the newtest_store.py). The nodes suite passes (1508 passed) including the Milvus tests; the full./builder testhas one unrelated failure —preprocessor_langchainfails to download PyTorch due to insufficient local disk space in my local (env issue, not this change).Checklist
Linked Issue
Fixes #1495
Summary by CodeRabbit
Bug Fixes
Tests