Skip to content

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

Merged
jsignell merged 3 commits into
dask:mainfrom
pavithraes:feature-dataframe-view
Jan 18, 2022
Merged

jsignell merged 3 commits into
dask:mainfrom
pavithraes:feature-dataframe-view

Conversation

@pavithraes

Copy link
Copy Markdown
Member

@GPUtester

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

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

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

Copy link
Copy Markdown
Collaborator

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!

Comment thread dask/dataframe/tests/test_dataframe.py Outdated
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
Copy Markdown
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)

Comment thread dask/dataframe/core.py Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

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

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Member

add to allowlist

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

Copy link
Copy Markdown
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