diff --git a/modin/core/dataframe/pandas/dataframe/dataframe.py b/modin/core/dataframe/pandas/dataframe/dataframe.py index d8a126dfbbe..fbaa5f3c707 100644 --- a/modin/core/dataframe/pandas/dataframe/dataframe.py +++ b/modin/core/dataframe/pandas/dataframe/dataframe.py @@ -2201,7 +2201,7 @@ def map( func, keep_partitioning=True, map_func_args=func_args, - **func_kwargs if func_kwargs is not None else {}, + map_func_kwargs=func_kwargs, ) else: new_partitions = ( diff --git a/modin/core/dataframe/pandas/partitioning/partition_manager.py b/modin/core/dataframe/pandas/partitioning/partition_manager.py index c25b18ff939..bf9c7103cb1 100644 --- a/modin/core/dataframe/pandas/partitioning/partition_manager.py +++ b/modin/core/dataframe/pandas/partitioning/partition_manager.py @@ -493,6 +493,7 @@ def broadcast_axis_partitions( enumerate_partitions=False, lengths=None, apply_func_args=None, + apply_func_kwargs=None, **kwargs, ): """ @@ -528,6 +529,8 @@ def broadcast_axis_partitions( 2. When passing lengths you must explicitly specify `keep_partitioning=False`. apply_func_args : list-like, optional Positional arguments to pass to the `func`. + apply_func_kwargs : dict, optional + Keyword arguments to pass to the `func`. **kwargs : dict Additional options that could be used by different engines. @@ -579,6 +582,7 @@ def broadcast_axis_partitions( left_partitions[i].apply( preprocessed_map_func, *(apply_func_args if apply_func_args else []), + **apply_func_kwargs if apply_func_kwargs is not None else {}, **kw, **({"partition_idx": idx} if enumerate_partitions else {}), **kwargs, @@ -691,6 +695,7 @@ def map_axis_partitions( lengths=None, enumerate_partitions=False, map_func_args=None, + map_func_kwargs=None, **kwargs, ): """ @@ -722,6 +727,8 @@ def map_axis_partitions( Note that `map_func` must be able to accept `partition_idx` kwarg. map_func_args : list-like, optional Positional arguments to pass to the `map_func`. + map_func_kwargs : dict, optional + Keyword arguments for the 'map_func'. **kwargs : dict Additional options that could be used by different engines. @@ -745,6 +752,7 @@ def map_axis_partitions( lengths=lengths, enumerate_partitions=enumerate_partitions, apply_func_args=map_func_args, + apply_func_kwargs=map_func_kwargs, **kwargs, ) @@ -768,9 +776,9 @@ def map_partitions_splitting_by_column( The number of splits by column. map_func : callable Function to apply. - func_args : iterable, optional + map_func_args : iterable, optional Positional arguments for the 'map_func'. - func_kwargs : dict, optional + map_func_kwargs : dict, optional Keyword arguments for the 'map_func'. Returns