Skip to content

[Python] Fix input mutation in BigQuery and Milvus vector search enrichment - #41990

Open
sakshammalik260-cse wants to merge 1 commit into
apache:masterfrom
sakshammalik260-cse:fix/41989-vector-enrichment-mutation
Open

sakshammalik260-cse wants to merge 1 commit into
apache:masterfrom
sakshammalik260-cse:fix/41989-vector-enrichment-mutation

Conversation

@sakshammalik260-cse

Copy link
Copy Markdown
Contributor

Fixes #41989.

Summary

The BigQuery and Milvus vector search enrichment handlers modify input metadata in place, which can affect other pipeline branches and cause elements sharing a metadata dictionary to receive incorrect enrichment results.

Changes

  • Use dataclasses.replace with a fresh metadata dictionary, following the existing Qdrant implementation.
  • Correct the BigQuery join_fn type annotations to use EmbeddableItem.
  • Add regression tests covering input immutability, shared metadata, repeated enrichment, and buffered pipeline execution.
  • Preserve existing optional-dependency skip behavior.

Testing

  • All 18 regression tests fail before the fix and pass afterward.
  • Complete BigQuery, Milvus, and Qdrant test suites pass on Python 3.11, 3.12, 3.13, and 3.14 (103 tests per version).
  • Related RAG, enrichment, and DirectRunner tests pass (32 tests).
  • Both new pipeline regression tests pass across 10 repeated runs.
  • Optional-dependency configurations and parallel test execution validated.
  • Full SDK Ruff, YAPF, Apache RAT, and git diff --check pass.
  • Changed-file Pyrefly reports zero errors.

Full Gradle Python jobs and external-service integration tests were not run to completion locally.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @tvalentyn added as fallback since no labels match configuration
Backup reviewer: jrmccluskey (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

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]: BigQuery and Milvus vector search enrichment modify the input elements in place

1 participant