Skip to content

test: add e2e cases for nullable vector backup and restore - #1048

Open
huanghaoyuanhhy wants to merge 1 commit into
zilliztech:mainfrom
huanghaoyuanhhy:add-nullable-vector-tests
Open

test: add e2e cases for nullable vector backup and restore#1048
huanghaoyuanhhy wants to merge 1 commit into
zilliztech:mainfrom
huanghaoyuanhhy:add-nullable-vector-tests

Conversation

@huanghaoyuanhhy

@huanghaoyuanhhy huanghaoyuanhhy commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add end-to-end coverage for nullable vector fields (Milvus 2.6.18 / 3.0.0 feature) through the backup/restore round-trip. Existing nullable tests only cover scalar fields (FLOAT, VARCHAR, JSON, ARRAY) — there is no coverage that the nullable=true flag and per-row NULL semantics survive backup + restore for vector fields.

Changes

  • Add tests/testcases/test_restore_nullable_vector.py with four test cases:
    • test_restore_nullable_vector_round_trip parameterized over the six vector dtypes in scope (FLOAT, FLOAT16, BFLOAT16, INT8, BINARY, SPARSE_FLOAT): asserts the restored field keeps nullable=true and that NULL / non-NULL rows are preserved per primary key.
    • test_restore_nullable_vector_search_skips_null: builds an index on the restored collection and confirms search hits are at most the non-NULL row count and never land on a NULL row.
    • test_restore_add_nullable_vector_field: exercises add_collection_field with a nullable vector field, then checks the field round-trips and pre-add rows come back as NULL.
    • test_restore_nullable_vector_with_skip_create_collection: negative case asserting that restoring NULL vector rows into a pre-created target with nullable=false fails fast (L2; expected to harden further once the restore path adds a pre-flight nullable schema check).

The tests bypass compare_collections and inspect rows directly via MilvusClient.query, because compare_collections does a strict src_res[i] == dist_res[i] which is ambiguous for numpy ndarray vector values and may not handle nullable vectors cleanly.

/kind improvement

@sre-ci-robot sre-ci-robot added the kind/improvement Changes related to something improve, likes ut and code refactor label May 19, 2026
@sre-ci-robot
sre-ci-robot requested a review from alohaha22 May 19, 2026 09:56
@sre-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: huanghaoyuanhhy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-commenter

codecov-commenter commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.50%. Comparing base (2309945) to head (43cfa30).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1048   +/-   ##
=======================================
  Coverage   42.50%   42.50%           
=======================================
  Files         136      136           
  Lines       12181    12181           
=======================================
  Hits         5178     5178           
  Misses       6624     6624           
  Partials      379      379           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@huanghaoyuanhhy
huanghaoyuanhhy force-pushed the add-nullable-vector-tests branch from 5de8c1b to 22a78ee Compare May 20, 2026 09:10
Signed-off-by: huanghaoyuanhhy <haoyuan.huang@zilliz.com>
@huanghaoyuanhhy
huanghaoyuanhhy force-pushed the add-nullable-vector-tests branch from 22a78ee to 43cfa30 Compare August 13, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-passed kind/improvement Changes related to something improve, likes ut and code refactor size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants