Skip to content

Make stringdtype parametric on na_object again #77

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

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

ngoldbaum
Copy link
Member

This backs out #67.

While working on #76 I realized I'd need to make stringdtype parametric, so I had to look into whether the dtype being parametric is a showstopper. It turns out the original reason I made the dtype parametric was solved by #70, so there's no problem with making the dtype parametric.

Making the dtype parametric eliminates a ton of copy/paste code and eliminates the runtime dependency on pandas if pandas is installed.

I checked and all of the string dtype tests in pandas pass when I update my fork of pandas to reflect this change in stringdtype.

if (ssdup(s, os) < 0) {
gil_error(PyExc_MemoryError, "ssdup failed");
return -1;
if (in != out) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This extra check was needed for cases when we're casting from an array to a view of the same array and the views have the same starting location. In that case we don't need to copy at all and if we did we'd have a use-after-free. Tricky!

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.

1 participant