Skip to content

fix: exclude function output fields when checking upsert columns - #3921

Closed
yuee3 wants to merge 1 commit into
milvus-io:masterfrom
yuee3:fix/upsert-schema-function-output
Closed

yuee3 wants to merge 1 commit into
milvus-io:masterfrom
yuee3:fix/upsert-schema-function-output

Conversation

@yuee3

@yuee3 yuee3 commented Nov 5, 2026

Copy link
Copy Markdown

Fixes #3868

Summary

check_upsert_schema() validated the input columns against every field in the schema, including fields produced by a Function (for example a BM25 sparse output). check_insert_schema() already excludes function outputs, so an upsert that only supplies the source columns is wrongly rejected with DataNotMatchException.

Fix

Filter out is_function_output fields before the column-count check, mirroring the insert path. The previous copy.deepcopy() is no longer needed because _check_data_schema_cnt() only reads the fields.

Test

Added test_check_upsert_schema_skips_function_output to tests/unit/orm/test_schema.py. It fails on master and passes with the fix. pytest tests/unit/orm/test_schema.py -> 255 passed; black/ruff clean.

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yuee3
To complete the pull request process, please assign tedxu after the PR has been reviewed.
You can assign the PR to them by writing /assign @tedxu in a comment when ready.

The full list of commands accepted by this bot can be found 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

@yuee3
yuee3 force-pushed the fix/upsert-schema-function-output branch from 891e7d7 to 7699a43 Compare November 5, 2026 02:48
@mergify mergify Bot added the dco-passed label Nov 5, 2026
@mergify

mergify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@yuee3

yuee3 commented Nov 5, 2026

Copy link
Copy Markdown
Author

Closing as a duplicate of #3870, which already addresses this issue. Sorry for the noise.

@yuee3 yuee3 closed this Nov 5, 2026
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.

[Bug]: Collection.upsert(DataFrame) wrongly raises DataNotMatchException when a function-output field is not the last schema field

2 participants