pitrou commented on code in PR #50409:
URL: https://github.com/apache/arrow/pull/50409#discussion_r3628220787
##########
python/pyarrow/src/arrow/python/common.h:
##########
@@ -398,8 +399,8 @@ struct PyBytesView {
// View the given Python object as binary-like, i.e. bytes
Status ParseBinary(PyObject* obj) {
if (PyBytes_Check(obj)) {
- bytes = PyBytes_AS_STRING(obj);
- size = PyBytes_GET_SIZE(obj);
+ bytes = PyBytes_AsString(obj);
+ size = PyBytes_Size(obj);
Review Comment:
Well, there's no reason for errors here so we can just have:
```c++
if (PyBytes_Check(obj)) {
bytes = PyBytes_AsString(obj);
size = PyBytes_Size(obj);
DCHECK(!PyErr_Occurred());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]