Repository navigation
Real testcontainers tests for Cassandra 5.0 (fixes ANN vector path) — #829 - #843
Merged
Merged
Conversation
…842) The cassandra-driver path was only MagicMock-tested, which hid that it created the embedding column as list<float> with no StorageAttachedIndex — so the ANN vector search (ORDER BY embedding ANN OF ...) failed on real Cassandra 5.0 — hardcoded score to 1.0, and returned [] after a reconnect. Create a vector<float, dim> column plus a cosine StorageAttachedIndex, return the real similarity_cosine score, and drop the reconnect guard (search returns [] on a missing-table InvalidRequest, covering search-before-add too). Adds real cassandra:5 testcontainers tests (an address-translator handles the mapped port) and removes the MagicMock test. (This store already offloaded via run_in_executor — async was fine.) Part of #829. Closes #842.
…842) The InvalidRequest handling and real similarity_cosine score must not require cassandra-driver at call time — the #785/#789 CQL query-building tests drive _cass_search_sync with a fake session and no driver installed. Import InvalidRequest optionally (empty tuple when absent) and read the score via getattr so fake rows without a score field still work.
Closed
18 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Next in epic #829: Cassandra (cassandra-driver mode, real Cassandra 5.0). The store already offloaded via
run_in_executor(async fine), but the vector path was broken (#842).Bugs found & fixed
list<float>instead ofvector<float, dim>+ no SAI index →ORDER BY embedding ANN OF ...failed on real Cassandra 5.0. Now creates a typed vector column + cosineStorageAttachedIndex.scorehardcoded to 1.0 → now the realsimilarity_cosine(embedding, <vec>).[]on a fresh instance; now returns[]only on a genuine missing-tableInvalidRequest.Verification (real data)
7/7 pass against
cassandra:5(an address-translator handles the testcontainers port mapping): real ANN vector search, real cosine scores, native metadata filter, reconnect via a second cluster/session, async contract. Wired into the CIintegrationjob.Commits
fix(retrieval): fix CassandraVectorStore against real Cassandra 5.0 (#842)ci(test): add cassandra-driver to the integration group and CI job (#829)style: ...Part of #829.