From cc5ae6998ee3f30b0dd770d06eecb755f5bc43b2 Mon Sep 17 00:00:00 2001 From: Wangshu Pang Date: Thu, 8 Oct 2026 19:28:49 -0700 Subject: [PATCH] [Python] Fix __int__ typo and join_fn type hints in Milvus search handler Remove the stray MilvusBaseRanker.__int__ (a typo for __init__ that made int(ranker) raise TypeError, and the base class has no state to initialize), and annotate join_fn with EmbeddableItem, which is what the handler actually passes in, instead of Embedding. Fixes #40474 Co-Authored-By: Claude Sonnet 5.5 --- sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py b/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py index cd310b784703..dfcec7abe6cb 100644 --- a/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py +++ b/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py @@ -32,7 +32,6 @@ from pymilvus.exceptions import MilvusException from apache_beam.ml.rag.types import EmbeddableItem -from apache_beam.ml.rag.types import Embedding from apache_beam.ml.rag.utils import MilvusConnectionParameters from apache_beam.ml.rag.utils import MilvusHelpers from apache_beam.ml.rag.utils import retry_with_backoff @@ -96,9 +95,6 @@ class VectorSearchMetrics(Enum): class MilvusBaseRanker: """Base class for ranking algorithms in Milvus hybrid search strategy.""" - def __int__(self): - return - def dict(self): return {} @@ -588,6 +584,6 @@ def batch_elements_kwargs(self) -> dict[str, int]: return self._batching_kwargs -def join_fn(left: Embedding, right: dict[str, Any]) -> Embedding: +def join_fn(left: EmbeddableItem, right: dict[str, Any]) -> EmbeddableItem: left.metadata['enrichment_data'] = right return left