AlenkaF commented on code in PR #41889:
URL: https://github.com/apache/arrow/pull/41889#discussion_r1638054651
##########
python/pyarrow/io.pxi:
##########
@@ -1424,6 +1430,18 @@ cdef class Buffer(_Weakrefable):
are_equal : bool
True if buffer contents and size are equal
"""
+ if self.device != other.device:
+ raise ValueError(
+ "Device on which the data resides differs between buffers: "
+ f"{self.device.type_name} and {other.device.type_name}."
+ )
+ if not self.is_cpu and not other.is_cpu:
Review Comment:
I rearranged a bit locally - think it makes more sense:
```python
if not self.is_cpu or not other.is_cpu:
if self.device != other.device or self.address != other.address:
raise NotImplementedError(
"Implemented only for data on CPU device or data with equal "
"addresses"
)
```
can push if not too late.
--
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]