diff --git a/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py b/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py index b7b0d888b78..2b6922ab092 100644 --- a/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py +++ b/modin/core/execution/dask/implementations/pandas_on_dask/io/io.py @@ -229,7 +229,25 @@ def from_map(cls, func, iterable, *args, **kwargs): return cls.query_compiler_cls(cls.frame_cls(partitions)) -def deploy_map_func(func, obj, *args, **kwargs): +def deploy_map_func(func, obj, *args, **kwargs): # pragma: no cover + """ + Deploy a func to apply to an object. + + Parameters + ---------- + func : callable + Function to map across the iterable object. + obj : object + An object to apply a function to. + *args : tuple + Positional arguments to pass in `func`. + **kwargs : dict + Keyword arguments to pass in `func`. + + Returns + ------- + pandas.DataFrame + """ result = func(obj, *args, **kwargs) if not isinstance(result, pandas.DataFrame): result = pandas.DataFrame(result) diff --git a/modin/core/execution/dispatching/factories/factories.py b/modin/core/execution/dispatching/factories/factories.py index 98c11b7be8e..aa94688e3df 100644 --- a/modin/core/execution/dispatching/factories/factories.py +++ b/modin/core/execution/dispatching/factories/factories.py @@ -222,10 +222,15 @@ def _from_dask(cls, dask_obj): return cls.io_cls.from_dask(dask_obj) @classmethod - @doc( - _doc_io_method_template, - source="a map function", - params=""" + def _from_map(cls, func, iterable, *args, **kwargs): + """ + Create a Modin `query_compiler` from a map function. + + This method will construct a Modin `query_compiler` split by row partitions. + The number of row partitions matches the number of elements in the iterable object. + + Parameters + ---------- func : callable Function to map across the iterable object. iterable : Iterable @@ -234,10 +239,12 @@ def _from_dask(cls, dask_obj): Positional arguments to pass in `func`. **kwargs : dict Keyword arguments to pass in `func`. - """, - method="from_map", - ) - def _from_map(cls, func, iterable, *args, **kwargs): + + Returns + ------- + BaseQueryCompiler + QueryCompiler containing data returned by map function. + """ return cls.io_cls.from_map(func, iterable, *args, **kwargs) @classmethod diff --git a/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py b/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py index 34cb574b0fa..24b9e0823fa 100644 --- a/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py +++ b/modin/core/execution/ray/implementations/pandas_on_ray/io/io.py @@ -345,7 +345,25 @@ def from_map(cls, func, iterable, *args, **kwargs): @ray.remote -def deploy_map_func(func, obj, *args, **kwargs): +def deploy_map_func(func, obj, *args, **kwargs): # pragma: no cover + """ + Deploy a func to apply to an object. + + Parameters + ---------- + func : callable + Function to map across the iterable object. + obj : object + An object to apply a function to. + *args : tuple + Positional arguments to pass in `func`. + **kwargs : dict + Keyword arguments to pass in `func`. + + Returns + ------- + pandas.DataFrame + """ result = func(obj, *args, **kwargs) if not isinstance(result, pandas.DataFrame): result = pandas.DataFrame(result) diff --git a/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py b/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py index 98783a2f1e2..9d870c8ed78 100644 --- a/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py +++ b/modin/core/execution/unidist/implementations/pandas_on_unidist/io/io.py @@ -300,7 +300,25 @@ def from_map(cls, func, iterable, *args, **kwargs): @unidist.remote -def deploy_map_func(func, obj, *args, **kwargs): +def deploy_map_func(func, obj, *args, **kwargs): # pragma: no cover + """ + Deploy a func to apply to an object. + + Parameters + ---------- + func : callable + Function to map across the iterable object. + obj : object + An object to apply a function to. + *args : tuple + Positional arguments to pass in `func`. + **kwargs : dict + Keyword arguments to pass in `func`. + + Returns + ------- + pandas.DataFrame + """ result = func(obj, *args, **kwargs) if not isinstance(result, pandas.DataFrame): result = pandas.DataFrame(result)