What happened?
Two small issues in sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py:
1. MilvusBaseRanker defines __int__ instead of __init__
|
class MilvusBaseRanker: |
|
"""Base class for ranking algorithms in Milvus hybrid search strategy.""" |
|
def __int__(self): |
|
return |
class MilvusBaseRanker:
def __int__(self):
return
This looks like a typo for __init__. As written, it defines the integer conversion hook, so int(ranker) would raise TypeError: __int__ returned non-int (type NoneType). Since the base class has no state to initialize, the method can simply be removed.
2. join_fn is annotated with Embedding but receives an EmbeddableItem
|
def join_fn(left: Embedding, right: dict[str, Any]) -> Embedding: |
|
left.metadata['enrichment_data'] = right |
|
return left |
def join_fn(left: Embedding, right: dict[str, Any]) -> Embedding:
left.metadata['enrichment_data'] = right
return left
The handler's input/output type is EmbeddableItem (InputT/OutputT in the same module), and Embedding has no metadata attribute. The annotation should be EmbeddableItem for both the parameter and the return type.
Neither issue changes runtime behavior for current users; the fix is a small cleanup. I plan to send a PR.
Issue Priority
Priority: 3 (minor)
Issue Components
What happened?
Two small issues in
sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py:1.
MilvusBaseRankerdefines__int__instead of__init__beam/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py
Lines 97 to 100 in c692c22
This looks like a typo for
__init__. As written, it defines the integer conversion hook, soint(ranker)would raiseTypeError: __int__ returned non-int (type NoneType). Since the base class has no state to initialize, the method can simply be removed.2.
join_fnis annotated withEmbeddingbut receives anEmbeddableItembeam/sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py
Lines 591 to 593 in c692c22
The handler's input/output type is
EmbeddableItem(InputT/OutputTin the same module), andEmbeddinghas nometadataattribute. The annotation should beEmbeddableItemfor both the parameter and the return type.Neither issue changes runtime behavior for current users; the fix is a small cleanup. I plan to send a PR.
Issue Priority
Priority: 3 (minor)
Issue Components