Skip to content

Commit 795ed60

Browse files
sdks/python: fix linting issues
1 parent b4e31e8 commit 795ed60

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

sdks/python/apache_beam/ml/rag/enrichment/milvus_search.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,3 @@ def batch_elements_kwargs(self) -> Dict[str, int]:
584584
def join_fn(left: Embedding, right: Dict[str, Any]) -> Embedding:
585585
left.metadata['enrichment_data'] = right
586586
return left
587-
588-
589-
def unpack_dataclass_with_kwargs(dataclass_instance):
590-
# Create a copy of the dataclass's __dict__.
591-
params_dict: dict = dataclass_instance.__dict__.copy()
592-
593-
# Extract the nested kwargs dictionary.
594-
nested_kwargs = params_dict.pop('kwargs', {})
595-
596-
# Merge the dictionaries, with nested_kwargs taking precedence
597-
# in case of duplicate keys.
598-
return {**params_dict, **nested_kwargs}

sdks/python/apache_beam/ml/rag/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from typing import List
2929
from typing import Optional
3030
from typing import Tuple
31+
from typing import Type
3132

3233
from apache_beam.ml.rag.types import Chunk
3334
from apache_beam.ml.rag.types import Content
@@ -148,7 +149,7 @@ def retry_with_backoff(
148149
retry_delay: float = 1.0,
149150
retry_backoff_factor: float = 2.0,
150151
operation_name: str = "operation",
151-
exception_types: Tuple[type, ...] = (Exception, )
152+
exception_types: Tuple[Type[BaseException], ...] = (Exception, )
152153
) -> Any:
153154
"""Executes an operation with retry logic and exponential backoff.
154155

0 commit comments

Comments
 (0)