Skip to content
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

There should be a From<Vec<Option<String>>> impl for GenericStringArray<OffsetSize> #3599

Closed
sinistersnare opened this issue Jan 24, 2023 · 2 comments · Fixed by #3602
Closed
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@sinistersnare
Copy link
Contributor

sinistersnare commented Jan 24, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

I have a Vec<Option<String>>, and I want it to be a StringArray. Right now the only relevant impls to do this are:

  • From<Vec<String>>
  • From<Vec<&str>>
  • From<Vec<Option<&str>>>

Relevant code here

So it seems reasonable for there to be an impl for Option<String>

Describe the solution you'd like

Adding this impl would allow me to do

let my_string: String = ...;
let stringarray: ArrayRef = Arc::new(StringArray::from(vec![Some(my_string), None]));

Additional context

I'm happy to add this if yall are interested. Just wanted to write this out to see if it could be considered.

@sinistersnare sinistersnare added the enhancement Any new improvement worthy of a entry in the changelog label Jan 24, 2023
@tustvold
Copy link
Contributor

tustvold commented Jan 25, 2023

Makes sense to me, would be happy to review a PR that implemented this.

FWIW from_iter should work I think

@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'arrow'} from #3602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants