Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dask.dataframe.series.view() #8533

Merged
merged 3 commits into from
Jan 18, 2022
Merged

Conversation

pavithraes
Copy link
Member

@GPUtester
Copy link
Collaborator

Can one of the admins verify this patch?

@ian-r-rose ian-r-rose self-requested a review January 5, 2022 17:21
Copy link
Collaborator

@ian-r-rose ian-r-rose left a comment

Choose a reason for hiding this comment

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

Thanks @pavithraes, this is looking good!

def test_view():
s = pd.Series(range(10), dtype="int8")
ds = dd.from_pandas(s, npartitions=2)
assert_eq(ds.view("uint8"), s.view("uint8"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

It think it's also worth adding a test for the original issue in #8439 (that is to say, that we can view a datetime without issue)

@@ -3839,6 +3839,10 @@ def is_monotonic_decreasing(self):
token="monotonic_decreasing",
)

@derived_from(pd.Series)
def view(self, dtype):
return self.map_partitions(M.view, dtype, enforce_metadata=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You may need to also update the _meta object for consistency

@pavithraes
Copy link
Member Author

@ian-r-rose Thanks for reviewing! I've addressed your comments. :)

Copy link
Collaborator

@ian-r-rose ian-r-rose left a comment

Choose a reason for hiding this comment

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

Thanks @pavithraes, this looks good to me!

@jsignell
Copy link
Member

add to allowlist

@jsignell jsignell merged commit 4b6acdb into dask:main Jan 18, 2022
@jsignell
Copy link
Member

This is in! Thanks @pavithraes :)

@pavithraes pavithraes deleted the feature-dataframe-view branch April 8, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Series / DataFrame view method not implemented.
4 participants