Repository navigation
BUG: fix the error msg of empty hstack input - #8801
Conversation
There was a problem hiding this comment.
An alternative fix would be to simply change this line to arrs and arrs[0].ndim == 1, which would then allow concatenate to produce an appropriate error message
There was a problem hiding this comment.
Thanks, that's really helpful!
There was a problem hiding this comment.
The other error message uses array not element.
There was a problem hiding this comment.
if not arrs would be more pythonic IMO
68603f1 to
7523ac5
Compare
|
@eric-wieser I have updated the implementation and squashed the previous commit. Thanks for the help! |
|
I'm not actually opposed but this will break backwards-compatibility. Code that checked for Maybe safer to go with some sort of In any case, shouldn't the change be tested? |
|
@MSeifert04: I agree, changing the exception API is perhaps risky. But a futurewarning wouldn't help because:
From a somewhat mean and not terribly valid point of view, if someone is relying on this behaviour and did not think to report the (relatively obvious) bug here, then perhaps they deserve the breakage? At any rate, Yes, this needs tests. And if they're not there already, |
|
Also, there's a typo in the commit message |
7523ac5 to
d5bbd85
Compare
|
@eric-wieser Fix the typo.Sorry about that. |
|
I would have saved that fixup till you add the tests, but whatever |
d5bbd85 to
9d225b9
Compare
|
@eric-wieser Hi, I added the test. I haven't done testing addition before, so please let me know if I did something wrong. Thanks! |
|
Test looks good - but let's add one for |
There was a problem hiding this comment.
Nit-pick: the test for concatenate uses () not []
9d225b9 to
235ce08
Compare
|
Updated the commit msg and tests. |
|
Looks good to me. Regarding @MSeifert04's comment, at the very least there should be something in the compatibility section of the 1.13 release notes |
235ce08 to
b1bc302
Compare
|
Updated the 1.13 release notes. |
eric-wieser
left a comment
There was a problem hiding this comment.
Generally looks good to me, but someone else should probably weigh in on @MSeifert04's point
There was a problem hiding this comment.
Bit unusual to have a heading with no content here
There was a problem hiding this comment.
I will change it. I didn't realize that is a heading line. I just thought that was a dividing line.
b1bc302 to
1273caf
Compare
|
Updated the header and content of 1.13 release notes. |
| =================== | ||
|
|
||
|
|
||
| Error type changes |
There was a problem hiding this comment.
You've reminded me that I should add another entry under this heading regarding #8584, so thanks for that
|
In theory, we probably shouldn't be changing error types, in practice it isn't uncomon and doesn't seem to cause problems. I don't really see how we can avoid it if we refactor python code as things are likely to fail in different places. i suppose we could do all checks up front but we generally rely on ducktyping failing one place or another. The errors are rarely part of the documentation... |
|
Thanks @ZZhaoTireless . |
|
Thanks for reviewing and merging my code :D |
Raise the meaningful error msg for np.hstack() under empty input.
Closes #8790