Skip to content

Commit

Permalink
[DataFrame] Implement __array_wrap__ (ray-project#2218)
Browse files Browse the repository at this point in the history
* Implement __array_wrap__

* Removing unnecessary test
  • Loading branch information
devin-petersohn authored and pschafhalter committed Jun 11, 2018
1 parent 61139e1 commit b886cec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions python/ray/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4926,9 +4926,8 @@ def __array__(self, dtype=None):
return to_pandas(self).__array__(dtype=dtype)

def __array_wrap__(self, result, context=None):
raise NotImplementedError(
"To contribute to Pandas on Ray, please visit "
"github.com/ray-project/ray.")
# TODO: This is very inefficient, see also __array__ and as_matrix
return to_pandas(self).__array_wrap__(result, context=context)

def __getstate__(self):
raise NotImplementedError(
Expand Down
7 changes: 0 additions & 7 deletions python/ray/dataframe/test/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3191,13 +3191,6 @@ def test___array__(ray_df, pandas_df):
assert np.array_equal(ray_df.__array__(), pandas_df.__array__())


def test___array_wrap__():
ray_df = create_test_dataframe()

with pytest.raises(NotImplementedError):
ray_df.__array_wrap__(None)


def test___getstate__():
ray_df = create_test_dataframe()

Expand Down

0 comments on commit b886cec

Please sign in to comment.