test: Expand MilvusOnlineStore integration test coverage#6299
Conversation
|
The This PR only touches Could a maintainer kick off a rerun of the failed 3.12/ubuntu job? Thanks! |
Sorry, something went wrong.
Adds three cases to test_retrieve_online_milvus_documents that exercise code paths adjacent to recent MilvusOnlineStore bug fixes (feast-dev#6275): 1. Empty-store query before any writes — verifies the v2 retrieval path returns 0 rows instead of raising when the collection exists but is empty. 2. Oversized top_k (top_k=5 on a 3-row dataset) — verifies the hit-parsing loop handles a result set smaller than the requested top_k and returns all available rows. 3. Cosine-metric variant via a second FeatureView with vector_search_metric="COSINE" — verifies the cosine index path end to end (write, index creation, retrieval). No new imports; all types were already imported in the module. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Alex Korbonits <alex@korbonits.com>
a20d15b to
5eb7471
Compare
April 22, 2026 13:05
8fc01a4
into
feast-dev:master
Apr 22, 2026
What does this PR do?
Expands
test_retrieve_online_milvus_documents(insdk/python/tests/integration/online_store/test_universal_online.py) with three additional cases that exercise code paths adjacent to the bug fixes in #6275.The existing test covered a single L2 vector query on a 3-row dataset with
top_k=2. This PR adds:1. Empty-store query
Queries
retrieve_online_documents_v2beforewrite_to_online_store, so the Milvus collection exists but is empty. Asserts 0 rows returned. Exercises the "no hits" path of the v2 retrieval code.2. Oversized
top_kQueries with
top_k=5on a 3-row dataset. Asserts all 3 rows are returned. Exercises the hit-parsing loop when the result set is smaller than the requested top_k — adjacent to the territory of bug #4 from #6275 (thebytes.fromhex(None)crash on a hit with a missing composite key).3. Cosine-metric variant
Creates a second FeatureView (
item_embeddings_cosine) withvector_search_metric="COSINE", writes the same dataset, and queries withdistance_metric="COSINE". Verifies the cosine index is created and queried end to end. The existing test only covered the L2 path.Motivation
Bug #4 in #6275 (
TypeError: fromhex argument must be str, not None) was caught by a unit test (test_milvus_retrieve_online_documents_v2_missing_entity_key), but the universal integration test for Milvus retrieval did not exercise any of the adjacent edges (empty results, trailing hits, non-L2 metric). This PR closes that gap.Tests
Verified locally against Milvus Lite:
No new imports are added; all types (
FeatureView,Field,Array,Float32,String,timedelta,item) were already imported in the module.Out of scope
test_retrieve_online_documents_v2universal parametrization: that test asserts a BM25-styletext_rankcontract that Milvus's currentLIKE-based text search does not satisfy. A capability-matrix refactor of the universal v2 test is a larger design question and will be raised separately.🤖 Generated with Claude Code