fix: keep EmptyArray in remove_structure#2219
Conversation
Codecov Report
Additional details and impacted files
|
jpivarski
left a comment
There was a problem hiding this comment.
This means that code that previously did not handle
EmptyArraywould now be expected to.
The thing I would do in this situation is to grep for all the calls to remove_structure and check that all of those call sites would be able to handle an EmptyArray. The fact that the test suite passes is half as good as that.
|
It seems to be entirely in |
|
Both of them send the result to |
|
I think my wording could have been better here; I am generally hesitant to change anything that we likely are making assumptions about. I did the same checks you did to be as confident as possible. I am glad you found the same results! (occasionally I have missed something like this despite thinking otherwise!) |
Fixes #2207 by preserving
EmptyArrayinak._do.remove_structure. This means that code that previously did not handleEmptyArraywould now be expected to. I don't think there are many places where this is actually a problem;EmptyArrayalready handles reduction, and flattening almost immediately returns the result.