Skip to content

fix(batch): preserve references without object properties - #2212

Open
po-et wants to merge 1 commit into
weaviate:mainfrom
po-et:fix/batch-reference-only-objects
Open

po-et wants to merge 1 commit into
weaviate:mainfrom
po-et:fix/batch-reference-only-objects

Conversation

@po-et

@po-et po-et commented Oct 18, 2026

Copy link
Copy Markdown

Batch objects with properties=None currently omit the entire protobuf properties message, including explicitly supplied references. DataObject defaults to properties=None, so a reference-only object can be reported as inserted even though its links were never sent. This affects both synchronous and asynchronous insert_many and the shared batch encoder.

For a collection with a related reference property and an existing target UUID, this call drops the reference from the outgoing request:

collection.data.insert_many([DataObject(references={"related": target_uuid})])

Serialize the properties message when references are supplied, using an empty ordinary-property mapping when necessary. Objects with neither properties nor references keep their existing wire representation.

Validation

  • Five regression cases fail on unchanged main: three protobuf round-trip cases and both public sync/async calls against a local mock gRPC server. The ordinary-property and empty-object controls already pass.
  • With the fix, the affected unit and mock files pass all 33 tests. The complete offline test/ suite passes 550 tests with 1 skipped.
  • Tests cover single UUID, UUID list and multi-target references, omitted/empty/populated properties and actual protobuf serialization. The public tests exercise real local HTTP/gRPC transport, with the database service simulated.
  • Ruff 0.14.7 lint/format and Flake8 pass for all changed files. Project Pyright 1.1.400 reports 0 errors and 0 warnings with the isolated Python environment.

Validated on Python 3.12.12 / macOS arm64. A real Weaviate database, Docker integration suite and other platforms were not exercised. AI assistance was used for investigation, implementation and validation.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

This branch has not been deployed

No deployments
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.

2 participants