You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling compute::take on a struct array with zero fields results in an array with length == 0, regardless of the length of the take array.
Expected behavior
The result should be a struct array with no fields and length == take_indices.len()
Additional context
In my own code I've found it too easy to drop struct array lengths. I wonder if it's worth:
Adding StructArray::try_new(fields, arrays, nulls, length)
Making StructArray::try_new(fields, arrays, nulls) return an error for empty fields instead of picking a default length
I like these ideas and have made a proposal in #7247 . There is some discussion on also just changing the signature of try_new (instead of adding a new method) which would be more explicitly breaking but more likely to help others catch the error. Feel free to weigh in if you feel strongly about the approach.
Describe the bug
Calling
compute::take
on a struct array with zero fields results in an array with length == 0, regardless of the length of the take array.Expected behavior
The result should be a struct array with no fields and length == take_indices.len()
Additional context
In my own code I've found it too easy to drop struct array lengths. I wonder if it's worth:
StructArray::try_new(fields, arrays, nulls, length)
StructArray::try_new(fields, arrays, nulls)
return an error for empty fields instead of picking a default lengthThe text was updated successfully, but these errors were encountered: