Allow the creation of String arrays from an interator of &Option<&str> #598
Labels
enhancement
Any new improvement worthy of a entry in the changelog
good first issue
Good for newcomers
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I am making constant arrays for tests from constant slices
With 1.53 Rust introduces the ability to turn constant slices into iterators. For example. However, the collect for
This does not work:
It produces this error:
But this does (for primitive arrays):
Instead, for strings we have to do
Describe the solution you'd like
I would like to be able to do (note the lack of
vec!
):Perhaps by making the
FromIter
implementation fancier (right now it hard codes aOption<&str>
but the iterator above tives a&Option<&str>
: https://github.com/apache/arrow-rs/blob/master/arrow/src/array/array_string.rs#L255-L262Additional context
Note -- the same sort if issue exists for
DictionaryArray
as wellDoes not work:
Does work
The text was updated successfully, but these errors were encountered: