Skip to content

Commit

Permalink
Use Iterable rather than List
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Jul 13, 2023
1 parent fcf4a69 commit 5f7d8d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cubed/runtime/executors/lithops.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def map_unordered(
"""
return_when = ALWAYS if use_backups else ANY_COMPLETED

inputs = list(map_iterdata)
start_times = {}
end_times = {}
backups: Dict[RetryingFuture, RetryingFuture] = {}
Expand All @@ -79,7 +78,7 @@ def map_unordered(
futures = map_with_retries(
lithops_function_executor,
partial_map_function,
inputs,
map_iterdata,
timeout=timeout,
include_modules=include_modules,
retries=retries,
Expand Down
4 changes: 2 additions & 2 deletions cubed/runtime/executors/lithops_retries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union

from lithops import FunctionExecutor
from lithops.future import ResponseFuture
Expand Down Expand Up @@ -87,7 +87,7 @@ def result(self, throw_except: bool = True, internal_storage: Any = None):
def map_with_retries(
function_executor: FunctionExecutor,
map_function: Callable[..., Any],
map_iterdata: List[Union[List[Any], Tuple[Any, ...], Dict[str, Any]]],
map_iterdata: Iterable[Union[List[Any], Tuple[Any, ...], Dict[str, Any]]],
timeout: Optional[int] = None,
include_modules: Optional[List[str]] = [],
retries: Optional[int] = None,
Expand Down

0 comments on commit 5f7d8d7

Please sign in to comment.