You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (Jira)" <ji...@apache.org> on 2020/03/13 03:11:00 UTC

[jira] [Commented] (ARROW-8105) [Python] pyarrow.array segfaults when passed masked array with shrunken mask

    [ https://issues.apache.org/jira/browse/ARROW-8105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17058391#comment-17058391 ] 

Wes McKinney commented on ARROW-8105:
-------------------------------------

I don't think the {{numpy.ma}} path has seen a lot of use (because {{numpy.ma}} is not widely used) so it doesn't surprise me that there are some issues like this

> [Python] pyarrow.array segfaults when passed masked array with shrunken mask
> ----------------------------------------------------------------------------
>
>                 Key: ARROW-8105
>                 URL: https://issues.apache.org/jira/browse/ARROW-8105
>             Project: Apache Arrow
>          Issue Type: Bug
>            Reporter: Daniel Nugent
>            Priority: Major
>             Fix For: 0.17.0
>
>
> {code:python}
> >>> import numpy as np, pyarrow as pa                               
> >>> pa.array(np.ma.array([0]))
> {code}
> I *think* the issue might be here because when the masked array has a shrunken mask, it's values is False rather than the boolean mask array.
> {code:python}
>         if isinstance(values, np.ma.MaskedArray):
>             if mask is not None:
>                 raise ValueError("Cannot pass a numpy masked array and "
>                                  "specify a mask at the same time")
>             else:
>                 mask = values.mask
>                 values = values.data
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)