Skip to content

fix: support struct vector fields in BulkWriter#3631

Merged
sre-ci-robot merged 2 commits into
milvus-io:masterfrom
zhuwenxing:fix/struct-array-bulk-writer-vectors
Jun 25, 2026
Merged

fix: support struct vector fields in BulkWriter#3631
sre-ci-robot merged 2 commits into
milvus-io:masterfrom
zhuwenxing:fix/struct-array-bulk-writer-vectors

Conversation

@zhuwenxing

@zhuwenxing zhuwenxing commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What this PR does

  • Adds BulkFileType.JSONL and writes one JSON object per line with .jsonl suffix.
  • Allows Local/Remote BulkWriter to persist/upload JSONL files instead of skipping them.
  • Allows BulkWriter struct-array subfields to use FLOAT_VECTOR, FLOAT16_VECTOR, BFLOAT16_VECTOR, INT8_VECTOR, and BINARY_VECTOR.
  • Normalizes struct vector payloads for Parquet output, including FLOAT16/BFLOAT16 byte payloads.
  • Uses ml_dtypes for BFLOAT16 JSON/CSV byte-vector decoding and includes it in the bulk_writer extra.
  • Adds unit coverage for JSON, JSONL, CSV, and Parquet BulkWriter output across the supported struct vector subfield types.

Tests

  • python -m pytest -q tests/unit/test_bulk_writer_buffer.py tests/unit/test_local_bulk_writer.py tests/unit/test_remote_bulk_writer.py
    • 95 passed
  • Milvus Python client E2E against local dev-cli deployment:
    • test_import_struct_array_vector_subfield_all_file_types
    • test_import_struct_array_vector_subfield_with_local_bulk_writer
    • 40 passed

@mergify

mergify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify mergify Bot added the dco-passed label Jun 25, 2026
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.78%. Comparing base (20a0e42) to head (a8bdef7).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pymilvus/bulk_writer/buffer.py 93.54% 2 Missing ⚠️
pymilvus/bulk_writer/bulk_writer.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3631      +/-   ##
==========================================
+ Coverage   93.49%   93.78%   +0.29%     
==========================================
  Files          69       69              
  Lines       15200    15238      +38     
==========================================
+ Hits        14211    14291      +80     
+ Misses        989      947      -42     

☔ 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.

@zhuwenxing
zhuwenxing force-pushed the fix/struct-array-bulk-writer-vectors branch from a30b82c to 9fd70db Compare June 25, 2026 07:30
@mergify mergify Bot added the ci-passed label Jun 25, 2026
@zhuwenxing
zhuwenxing force-pushed the fix/struct-array-bulk-writer-vectors branch from 9fd70db to 49c6a70 Compare June 25, 2026 07:35
@mergify mergify Bot removed the ci-passed label Jun 25, 2026
@zhuwenxing
zhuwenxing force-pushed the fix/struct-array-bulk-writer-vectors branch from 49c6a70 to 94df45a Compare June 25, 2026 07:45
@mergify mergify Bot added the ci-passed label Jun 25, 2026
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
@zhuwenxing
zhuwenxing force-pushed the fix/struct-array-bulk-writer-vectors branch from 94df45a to cac8d73 Compare June 25, 2026 07:55
@mergify mergify Bot added ci-passed and removed ci-passed labels Jun 25, 2026
@SpadeA-Tang

Copy link
Copy Markdown
Contributor

/lgtm

@zhuwenxing

Copy link
Copy Markdown
Contributor Author

/assign @XuanYang-cn
PTAL

@zhuwenxing

Copy link
Copy Markdown
Contributor Author

/hold

@zhuwenxing

Copy link
Copy Markdown
Contributor Author

/unhold

@XuanYang-cn XuanYang-cn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one blocking BulkWriter serialization regression.

nit: pymilvus/bulk_writer/__init__.py still omits ml_dtypes from the existing missing-package guard, so users who have the older bulk_writer extras except ml_dtypes get a raw import failure instead of the package install guidance; add ml_dtypes to expected_pkgs.

Comment thread pymilvus/bulk_writer/bulk_writer.py
Comment thread pyproject.toml
@sre-ci-robot sre-ci-robot removed the lgtm label Jun 25, 2026
@mergify mergify Bot removed the ci-passed label Jun 25, 2026
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
@zhuwenxing
zhuwenxing force-pushed the fix/struct-array-bulk-writer-vectors branch from a319f1a to a8bdef7 Compare June 25, 2026 09:41

@XuanYang-cn XuanYang-cn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XuanYang-cn, zhuwenxing

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

@sre-ci-robot
sre-ci-robot merged commit 3c58d45 into milvus-io:master Jun 25, 2026
14 checks passed
@pymilvus-bot

Copy link
Copy Markdown
Collaborator

Backport Created
Hi @zhuwenxing, Backport PR for 3.0 has been created: #3637

(cc @XuanYang-cn @SpadeA-Tang)

sre-ci-robot pushed a commit that referenced this pull request Jun 25, 2026
#3637)

Backport of #3631 to `3.0`.

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Signed-off-by: pymilvus-bot <pymilvus-bot@users.noreply.github.com>
Co-authored-by: zhuwenxing <wenxing.zhu@zilliz.com>
@pymilvus-bot

Copy link
Copy Markdown
Collaborator

Backport Created: 2.6 -> #3669

pymilvus-bot added a commit to pymilvus-bot/pymilvus that referenced this pull request Jul 7, 2026
Cherry-pick of milvus-io#3631 and milvus-io#3658.

Backports fix: support struct vector fields in BulkWriter to `2.6`.
Backports fix(bulk_writer): preserve remote upload prefixes on Windows to `2.6`.

pr: milvus-io#3631
pr: milvus-io#3658
Signed-off-by: pymilvus-bot <pymilvus@zilliz.com>
sre-ci-robot pushed a commit that referenced this pull request Jul 7, 2026
…3669)

Cherry-pick of #3631 and #3658.

Backports fix: support struct vector fields in BulkWriter to `2.6`.
Backports fix(bulk_writer): preserve remote upload prefixes on Windows
to `2.6`.

pr: #3631
pr: #3658

Signed-off-by: pymilvus-bot <pymilvus@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants