-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Make dtype.descr error for out-of-order fields #10391
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
I think this might make debugging downstream problems with 1.14 easier, so would be inclined to get this into 1.14.1. Updated with tests |
ffbb286
to
646279a
Compare
646279a
to
dd8a2a8
Compare
# represent that | ||
y = self.data[['col2', 'col1']] | ||
assert_equal(y.dtype.names, ('col2', 'col1')) | ||
assert_raises(ValueError, lambda: y.dtype.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.
Previously returned [('', '|V4'), ('col2', '<i4'), ('col1', '<i4')]
, which swapped col1 with col3!
Yes, this seems like the right thing to do, no matter what we decide to do about #10387. |
LGTM. I plan to merge after sleeping on it :) While I'm here I'll just link to #10389, since it is related. (I was going to suggest mentioning it in the commit message, but this PR doesn't actually fix it.) |
I think in both cases, we need a convenient way to request the fields be reordered to something compatible - perhaps via a copy, or just a shuffle of the field order |
All right, let's merge this to help root out bugs. |
cc @ahaldane since #6053 exposes this to user code more often.
Currently returns garbage, Now