Skip to content

Commit

Permalink
Re-enable disabled regression test and fix a minor bug in equals meth…
Browse files Browse the repository at this point in the history
…od (#68)

* Re-enable disabled regression test and fix a minor bug in equals method

* Fixing python2 compatibility

* Fix lint
  • Loading branch information
frreiss authored and devin-petersohn committed Aug 4, 2018
1 parent cc47fdd commit 4311f97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2007,6 +2007,9 @@ def equals(self, other):
Returns:
Boolean: True if equal, otherwise False
"""
if isinstance(other, pandas.DataFrame):
# Copy into a Ray DataFrame to simplify logic below
other = DataFrame(other)

if not self.index.equals(other.index) or not \
self.columns.equals(other.columns):
Expand Down
8 changes: 4 additions & 4 deletions modin/pandas/test/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_int_dataframe():
test_pipe(ray_df, pandas_df)

# test_loc(ray_df, pandas_df)
# test_iloc(ray_df, pandas_df)
test_iloc(ray_df, pandas_df)

labels = ['a', 'b', 'c', 'd']
test_set_axis(ray_df, pandas_df, labels, 0)
Expand Down Expand Up @@ -314,7 +314,7 @@ def test_float_dataframe():
test_itertuples(ray_df, pandas_df)

# test_loc(ray_df, pandas_df)
# test_iloc(ray_df, pandas_df)
test_iloc(ray_df, pandas_df)

labels = ['a', 'b', 'c', 'd']
test_set_axis(ray_df, pandas_df, labels, 0)
Expand Down Expand Up @@ -496,7 +496,7 @@ def test_mixed_dtype_dataframe():
test_itertuples(ray_df, pandas_df)

# test_loc(ray_df, pandas_df)
# test_iloc(ray_df, pandas_df)
test_iloc(ray_df, pandas_df)

labels = ['a', 'b', 'c', 'd']
test_set_axis(ray_df, pandas_df, labels, 0)
Expand Down Expand Up @@ -647,7 +647,7 @@ def test_nan_dataframe():
test_itertuples(ray_df, pandas_df)

# test_loc(ray_df, pandas_df)
# test_iloc(ray_df, pandas_df)
test_iloc(ray_df, pandas_df)

labels = ['a', 'b', 'c', 'd']
test_set_axis(ray_df, pandas_df, labels, 0)
Expand Down
5 changes: 5 additions & 0 deletions modin/pandas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ def extractor(df_chunk, row_loc, col_loc):
except AttributeError:
# Locators might be scaler or python list
pass
# Python2 doesn't allow writable flag to be set on this object. Copying
# into a list allows it to be used by iloc.
except ValueError:
row_loc = list(row_loc)
col_loc = list(col_loc)
return df_chunk.iloc[row_loc, col_loc]


Expand Down

0 comments on commit 4311f97

Please sign in to comment.