Skip to content

Real testcontainers tests for Weaviate (fixes fully-broken v4 store) — #829 - #839

Merged
AmitoVrito merged 2 commits into
mainfrom
feat/issue-829-testcontainers-weaviate
Jul 21, 2026
Merged

AmitoVrito merged 2 commits into
mainfrom
feat/issue-829-testcontainers-weaviate

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Summary

Next in epic #829: Weaviate (weaviate-client v4). It had no test at all before — the survey only found a MagicMock reference — and deep testing shows the store was broken end-to-end against real Weaviate (#838).

Bugs found & fixed

  • Blocked the event loop (sync v4 client in async def).
  • No vectors attached on insert — insert_many(data_objects=, vectors=) misuse; v4 wants DataObject(properties, vector).
  • Collection never created — collections.get doesn't raise for a missing collection; use collections.exists.
  • return_metadata list instead of MetadataQuery, and score always 0.0 (near_vector has no score) — now derived from cosine distance.
  • Metadata dropped + filter broken (return_properties=["content"]) — now returns all properties + native Filter.
  • Missing gRPC endpoint in connect_to_custom (v4 requires it).

Verification (real data)

8/8 pass against real weaviate (http + gRPC): real inserts with vectors, real near_vector ranking, native filter, reconnect via a second client, async contract. Wired into the CI integration job.

Commits

  • fix(retrieval): fix WeaviateVectorStore against a real Weaviate v4 (#838)
  • ci(test): add weaviate-client to the integration group and CI job (#829)

Part of #829.

)

Never tested against a real Weaviate — the only coverage was a MagicMock — so the
whole store was broken on the v4 client: it blocked the event loop (sync client in
async def), attached no vectors on insert (insert_many misuse), never created the
collection (collections.get doesn't raise for a missing one), passed a list where
v4 wants MetadataQuery, scored every result 0.0, dropped metadata via
return_properties so the filter never matched, and omitted the required gRPC
endpoint.

Rewritten for weaviate-client v4: offload via asyncio.to_thread, insert
DataObject(properties, vector), use collections.exists, derive score from cosine
distance, apply a native Filter, and configure gRPC. Adds the first real
weaviate testcontainers tests (nearest-neighbour ranking, metadata filter, top_k,
reconnect persistence, negatives, async contract).

Part of #829. Closes #838.
@AmitoVrito
AmitoVrito merged commit 60c288d into main Jul 21, 2026
15 checks passed
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.

1 participant