Skip to content

Commit

Permalink
FIX-modin-project#2322: address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Nov 6, 2020
1 parent 504fd91 commit c1bbb24
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions modin/engines/base/frame/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1674,14 +1674,12 @@ def _copartition(self, axis, other, how, sort, force_repartition=False):

is_aligning_applied = False
for i in range(len(other)):
# aligning partitions
if (
len(self._partitions) != len(other[i]._partitions)
and len(self.axes[0]) == len(other[i].axes[0])
and axis == 0
):
is_aligning_applied = True
# we shouldn't modificate modin frame' partitions directly
self._partitions = self._frame_mgr_cls.map_axis_partitions(
axis, self._partitions, lambda df: df
)
Expand All @@ -1693,7 +1691,6 @@ def _copartition(self, axis, other, how, sort, force_repartition=False):
all(o.axes[axis].equals(self.axes[axis]) for o in other)
and not is_aligning_applied
):
# aligning self.list_of_blocks
return (
self._partitions,
[self._simple_shuffle(axis, o) for o in other],
Expand All @@ -1708,7 +1705,7 @@ def _copartition(self, axis, other, how, sort, force_repartition=False):
right_old_idxes = index_other_obj

def make_map_func():
if len(joined_index) != len(joined_index.unique()) and axis == 0:
if not joined_index.is_unique and axis == 0:
return lambda df: df
return lambda df: df.reindex(joined_index, axis=axis)

Expand All @@ -1718,7 +1715,6 @@ def make_map_func():
):
reindexed_self = self._partitions
else:
# aligning index without aligning partition' blocks
reindexed_self = self._frame_mgr_cls.map_axis_partitions(
axis,
self._partitions,
Expand All @@ -1740,7 +1736,6 @@ def get_row_lengths(partitions):
):
reindexed_other = other[i]._partitions
else:
# aligning index with aligning partition' blocks
reindexed_other = other[i]._frame_mgr_cls.map_axis_partitions(
axis,
other[i]._partitions,
Expand Down

0 comments on commit c1bbb24

Please sign in to comment.