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
[Python] Add a mask argument to pyarrow.StructArray.from_arrays #28425
Comments
&res / @0x26res: I'm not sure if it's the right place to mention that, but I now have the same issue with ListArray, and I'm wondering if it'd be worth doing the same changes there.
Here's an example where I'm have a list of struct, but some of the list are null:
|
Are you saying this because a copy of the inverted mask array is required? Or is there another overhead. I guess if we have to do a copy of the array, than memory_pool shoud be added to 'from_arrays' to be consistent, but it would make things confusing. Personally I'm happy with using from_buffer. The API isn't great, but once you've figured it out it's fine.
|
Joris Van den Bossche / @jorisvandenbossche:
Indeed, inverting the mask is indeed the "overhead" I was pointing at. |
It's odd, but you can do it by putting a null in the offsets array. I added some examples to ListArray.from_arrays as part of the PR. |
Weston Pace / @westonpace: |
The python API for creating StructArray from a list of array doesn't allow to pass a missing value mask.
At the moment the only way to create a StructArray with missing value is to use
pyarrow.array
and passing a vector of tuple.The C++ API allows it, so it should be easy to add.
see this so question
Reporter: &res / @0x26res
Assignee: Weston Pace / @westonpace
PRs and other links:
Note: This issue was originally created as ARROW-12677. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: