Skip to content

[DataFrame] Added Implementations for equals, query, and some other operations#1610

Merged
devin-petersohn merged 8 commits intoray-project:masterfrom
kunalgosar:dataframes
Feb 27, 2018
Merged

[DataFrame] Added Implementations for equals, query, and some other operations#1610
devin-petersohn merged 8 commits intoray-project:masterfrom
kunalgosar:dataframes

Conversation

@kunalgosar
Copy link
Copy Markdown
Contributor

@kunalgosar kunalgosar commented Feb 26, 2018

What do these changes do?

The APIs for these implementations conform to that of pandas, many of the other operators rely on mapped calls to pandas functions.

This PR implements:

  1. equals
  2. query
  3. __ iter__
  4. __ abs__
  5. __ eq__
  6. __ ne__
  7. __ neg__

@AmplabJenkins
Copy link
Copy Markdown

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3971/
Test PASSed.

Copy link
Copy Markdown
Member

@devin-petersohn devin-petersohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Just a few comments and minor changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer these be in @pytest.fixture calls and pass the different dataframes to it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also pass in what you want to query for.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're adding this convenience method (which I agree is a good idea) we will also need to update columns and index.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added them, and you can update just the fields you want.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer name change to _compute_lengths(). We have a set and the name doesn't sound much different.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataFrames can be empty. This is fine to leave for now, but we need to handle this case (also above in the constructor)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I just conformed to the current constructor for now, but this should be changed later.

@AmplabJenkins
Copy link
Copy Markdown

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3981/
Test PASSed.

@AmplabJenkins
Copy link
Copy Markdown

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3982/
Test PASSed.

Copy link
Copy Markdown
Member

@devin-petersohn devin-petersohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@devin-petersohn
Copy link
Copy Markdown
Member

Passed on private-travis. OK to merge. Thanks @kunalgosar!

@devin-petersohn devin-petersohn merged commit 48bd7b1 into ray-project:master Feb 27, 2018
@kunalgosar kunalgosar deleted the dataframes branch February 27, 2018 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants