Skip to content

Commit

Permalink
allow to pass iterable object
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Oct 20, 2023
1 parent 76aec65 commit ad2facd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions modin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from typing import (
Any,
Callable,
Iterable,
List,
Mapping,
Optional,
Expand Down Expand Up @@ -606,18 +607,18 @@ def try_cast_to_pandas(obj: Any, squeeze: bool = False) -> Any:
return obj


def execute(obj: Any) -> None:
def execute(objs: Iterable[Any]) -> None:
"""
Trigger the `obj` lazy computations, if any, and wait for them to complete.
Trigger the lazy computations for each obj in `objs`, if any, and wait for them to complete.
Parameters
----------
obj : Any
An object to trigger lazy computations.
objs : Iterable[Any]
A collection of objects to trigger lazy computations.
"""
if not hasattr(obj, "_query_compiler"):
return
obj._query_compiler.execute()
for obj in objs:
if hasattr(obj, "_query_compiler"):
obj._query_compiler.execute()

Check warning on line 621 in modin/utils.py

View check run for this annotation

Codecov / codecov/patch

modin/utils.py#L619-L621

Added lines #L619 - L621 were not covered by tests


def wrap_into_list(*args: Any, skipna: bool = True) -> List[Any]:
Expand Down

0 comments on commit ad2facd

Please sign in to comment.