Skip to content

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

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

Add dask.dataframe.series.view()#8533
jsignell merged 3 commits intodask:mainfrom
pavithraes:feature-dataframe-view

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)


@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