You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2021/04/21 15:51:00 UTC

[jira] [Resolved] (ARROW-12495) [C++][Python] NumPy buffer sets is_mutable_ to true but does not set mutable_data_ when the NumPy array is writable

     [ https://issues.apache.org/jira/browse/ARROW-12495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Pitrou resolved ARROW-12495.
------------------------------------
    Resolution: Fixed

Issue resolved by pull request 10122
[https://github.com/apache/arrow/pull/10122]

> [C++][Python] NumPy buffer sets is_mutable_ to true but does not set mutable_data_ when the NumPy array is writable
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-12495
>                 URL: https://issues.apache.org/jira/browse/ARROW-12495
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>            Reporter: Wes McKinney
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Bug is evident
> {code}
> NumPyBuffer::NumPyBuffer(PyObject* ao) : Buffer(nullptr, 0) {
>   PyAcquireGIL lock;
>   arr_ = ao;
>   Py_INCREF(ao);
>   if (PyArray_Check(ao)) {
>     PyArrayObject* ndarray = reinterpret_cast<PyArrayObject*>(ao);
>     data_ = reinterpret_cast<const uint8_t*>(PyArray_DATA(ndarray));
>     size_ = PyArray_SIZE(ndarray) * PyArray_DESCR(ndarray)->elsize;
>     capacity_ = size_;
>     if (PyArray_FLAGS(ndarray) & NPY_ARRAY_WRITEABLE) {
>       is_mutable_ = true;
>     }
>   }
> }
> {code}



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