-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
MAINT: Add a proper implementation for structured zerofill #23620
Conversation
This reorganizes the generic traversal functions for structured dtypes a bit (before it wasn't quite generic). Then uses that for zerofilling. We could get the two a bit closer by also supporting `func==NULL` explicitly for clearing. (I have not includes this here.) The old `FillObjectArray` is still in use now, this is not ideal and the new approach should be duplicated to add an "emptyfill" (same semantics, normally just memset to 0, but for objects we place an explicit `None` object). This is a necessary follow-up to numpygh-23591.
5a2b25f
to
534c2e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the stringdtype tests pass with this PR and I didn't see any code issues to comment about, LGTM!
One test we could add there (if you like), is that this should make |
Nice! It looks like it does successfully create the array with this PR (on
|
Was the error above fixed? |
The error Nathan referred to was in the printing code and is unrelated to this code. This fixes the assert (since it won't use that function anymore). |
We can file an issue about the structured dtype printing issue and fix that in a followup. |
Thanks Sebastian. |
This reorganizes the generic traversal functions for structured dtypes a bit (before it wasn't quite generic).
Then uses that for zerofilling. We could get the two a bit closer by also supporting
func==NULL
explicitly for clearing. (I have not includes this here.)The old
FillObjectArray
is still in use now, this is not ideal and the new approach should be duplicated to add an "emptyfill" (same semantics, normally just memset to 0, but for objects we place an explicitNone
object).This is a necessary follow-up to gh-23591.