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 2021/04/21 13:59:00 UTC
[jira] [Created] (ARROW-12495) [C++][Python] NumPy buffer sets
is_mutable_ to true but does not set mutable_data_ when the NumPy array is
writable
Wes McKinney created ARROW-12495:
------------------------------------
Summary: [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
Fix For: 4.0.0
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)