Skip to content

Commit

Permalink
FIX-#2470: revert b867edf (#2471)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Myskov <[email protected]>
  • Loading branch information
amyskov authored Nov 23, 2020
1 parent 41d3111 commit f7f1f7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 3 additions & 5 deletions modin/engines/base/frame/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,7 @@ def astype(self, col_dtypes):
def astype_builder(df):
return df.astype({k: v for k, v in col_dtypes.items() if k in df})

new_frame = self._frame_mgr_cls.lazy_map_partitions(
self._partitions, astype_builder
)
new_frame = self._frame_mgr_cls.map_partitions(self._partitions, astype_builder)
return self.__constructor__(
new_frame,
self.index,
Expand Down Expand Up @@ -1145,7 +1143,7 @@ def _map_reduce(self, axis, map_func, reduce_func=None, preserve_index=True):
else:
reduce_func = self._build_mapreduce_func(axis, reduce_func)

map_parts = self._frame_mgr_cls.lazy_map_partitions(self._partitions, map_func)
map_parts = self._frame_mgr_cls.map_partitions(self._partitions, map_func)
reduce_parts = self._frame_mgr_cls.map_axis_partitions(
axis, map_parts, reduce_func
)
Expand All @@ -1171,7 +1169,7 @@ def _map(self, func, dtypes=None, validate_index=False, validate_columns=False):
-------
A new dataframe.
"""
new_partitions = self._frame_mgr_cls.lazy_map_partitions(self._partitions, func)
new_partitions = self._frame_mgr_cls.map_partitions(self._partitions, func)
if dtypes == "copy":
dtypes = self._dtypes
elif dtypes is not None:
Expand Down
10 changes: 3 additions & 7 deletions modin/engines/base/frame/partition_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def broadcast_apply(cls, axis, apply_func, left, right, other_name="r"):
new_partitions = np.array(
[
[
part.add_to_apply_calls(
part.apply(
apply_func,
**{other_name: right[col_idx] if axis else right[row_idx]},
)
Expand Down Expand Up @@ -587,9 +587,7 @@ def _apply_func_to_list_of_partitions_broadcast(
):
preprocessed_func = cls.preprocess_func(func)
return [
obj.add_to_apply_calls(
preprocessed_func, other=[o.get() for o in broadcasted], **kwargs
)
obj.apply(preprocessed_func, other=[o.get() for o in broadcasted], **kwargs)
for obj, broadcasted in zip(partitions, other.T)
]

Expand All @@ -608,9 +606,7 @@ def _apply_func_to_list_of_partitions(cls, func, partitions, **kwargs):
A list of BaseFramePartition objects.
"""
preprocessed_func = cls.preprocess_func(func)
return [
obj.add_to_apply_calls(preprocessed_func, **kwargs) for obj in partitions
]
return [obj.apply(preprocessed_func, **kwargs) for obj in partitions]

@classmethod
def apply_func_to_select_indices(
Expand Down

0 comments on commit f7f1f7a

Please sign in to comment.