Skip to content

Commit

Permalink
FIX-#2709: fixed typo in '_copartition' (#2710)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Chigarev <[email protected]>
  • Loading branch information
dchigarev authored Feb 9, 2021
1 parent e74e012 commit 8a50c4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modin/engines/base/frame/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ def get_axis_lengths(partitions, axis):
or others_lengths[i] != base_lengths
)

# perform repartitioning and reindexing for `other` frames if needed
# perform repartitioning and reindexing for `other_frames` if needed
reindexed_other_list = [None] * len(other_frames)
for i in range(len(other_frames)):
if do_repartition_others[i]:
Expand All @@ -1819,7 +1819,7 @@ def get_axis_lengths(partitions, axis):
i
]._frame_mgr_cls.map_axis_partitions(
axis,
other[i]._partitions,
other_frames[i]._partitions,
make_reindexer(do_repartition_others[i], base_frame_idx + 1 + i),
lengths=base_lengths,
)
Expand Down
7 changes: 6 additions & 1 deletion modin/pandas/test/dataframe/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,8 @@ def test___setitem__(data):

df_equals(modin_df, pandas_df)


def test___setitem__partitions_aligning():
# from issue #2390
modin_df = pd.DataFrame({"a": [1, 2, 3]})
pandas_df = pandas.DataFrame({"a": [1, 2, 3]})
Expand All @@ -1259,12 +1261,15 @@ def test___setitem__(data):
# Setting new column
pd_df["b"] = pandas.Series(np.arange(4))
md_df["b"] = pd.Series(np.arange(4))

df_equals(md_df, pd_df)

# Setting existing column
pd_df["b"] = pandas.Series(np.arange(4))
md_df["b"] = pd.Series(np.arange(4))
df_equals(md_df, pd_df)

pd_df["a"] = pandas.Series(np.arange(4))
md_df["a"] = pd.Series(np.arange(4))
df_equals(md_df, pd_df)


Expand Down

0 comments on commit 8a50c4a

Please sign in to comment.