Skip to content

Commit

Permalink
Test3
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyPavlenko committed Dec 8, 2023
1 parent f489f07 commit 0977f2f
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,19 @@ def apply(self, func: Callable, *args, **kwargs):
Note: the function is not applied immediately but is added to the execution tree.
"""
return self.__constructor__(
DeferredExecution(self._data_ref, func, args, kwargs)
)
data = self._data_ref
if not isinstance(data, DeferredExecution):
flat_args = not has_list_or_de(args)
flat_kwargs = not has_list_or_de(kwargs.values())
if flat_args and flat_kwargs:
result = remote_exec_func.remote(func, data, *args, **kwargs)
return self.__constructor__(*result)
de = DeferredExecution(data, func, args, kwargs, 1, flat_args, flat_kwargs)

Check warning on line 108 in modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py

View check run for this annotation

Codecov / codecov/patch

modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py#L101-L108

Added lines #L101 - L108 were not covered by tests
else:
de = DeferredExecution(data, func, args, kwargs)
part = self.__constructor__(de)
part.drain_call_queue()
return part

Check warning on line 113 in modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py

View check run for this annotation

Codecov / codecov/patch

modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py#L110-L113

Added lines #L110 - L113 were not covered by tests

@_inherit_docstrings(PandasDataframePartition.add_to_apply_calls)
def add_to_apply_calls(self, func, *args, length=None, width=None, **kwargs):
Expand Down

0 comments on commit 0977f2f

Please sign in to comment.