Skip to content

Commit

Permalink
FIX-#3860: Fix single row Series assignment. (#3894)
Browse files Browse the repository at this point in the history
Signed-off-by: mvashishtha <mahesh@ponder.io>
  • Loading branch information
mvashishtha committed Jan 7, 2022
1 parent be10ba9 commit 0d9d14e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modin/pandas/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,9 @@ def get_axis(axis):
for i, lookup in enumerate([row_lookup, col_lookup])
]

if (
if col_lookup_len == 1 and row_lookup_len == 1:
axis = None
elif (
row_lookup_len == len(self.qc.index)
and col_lookup_len == 1
and isinstance(self.df, DataFrame)
Expand Down
8 changes: 8 additions & 0 deletions modin/pandas/test/dataframe/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,14 @@ def test___setitem__(data):
pandas_df[1:5] = 10
df_equals(modin_df, pandas_df)

# Test assigning a single item in a Series for issue
# https://github.com/modin-project/modin/issues/3860
modin_single_item_series = pd.Series(99)
pandas_single_item_series = pandas.Series(99)
modin_single_item_series[:1] = pd.Series(100)
pandas_single_item_series[:1] = pandas.Series(100)
df_equals(modin_single_item_series, pandas_single_item_series)


def test___setitem__partitions_aligning():
# from issue #2390
Expand Down

0 comments on commit 0d9d14e

Please sign in to comment.