-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: partially revert gh-28154 #28198
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
Conversation
} | ||
if (in_descr) { | ||
else if (in_descr && !PyArray_ISNBO(in_descr->byteorder)) { | ||
PyArray_DESCR_REPLACE_CANONICAL(in_descr); |
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.
Should we go all the way back and not use PyArray_DESCR_REPLACE_CANONICAL
for backport?
(Basically, just adding the extra !PyArray_ISNBO(in_descr->byteorde
).
But if not, this looks fine. It'll solve the crash-regression for sure, thanks!
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.
I think that makes more sense to do to the 2.2.x branch than to main
. I'd rather use ensure_canonical
in more places. I'll just go ahead and make another PR to the stable branch with the minimal change, just in case there are other structured dtype breakages that didn't get so quickly reported.
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.
See #28201
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.
OK, but that means you need to make a different/dedicated backport PR against 2.2.x
? (If I think about it again, for main
we could potentially keep the code exactly as is, the bug may be only in searchsorted
(the bug being that the dtype
passed in may be replaced, so one cannot keep using it).
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.
Ah, thanks for the backport. I'll have another look at searchsorted, maybe we can just fix it up there (and maybe add a brief release note just in case).
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.
Great! Feel free to close this if you come up with an alternate fix.
Closing in favor of #28418 |
Fixes #28190.
Partially reverts gh-28154, in particular the changes to the no-descriptor, array operand, and is byteswapped codepaths that structured arrays are affected by.