jorisvandenbossche opened a new pull request, #42010:
URL: https://github.com/apache/arrow/pull/42010

   ### Rationale for this change
   
   The various Python reprs or the C++ `PrettyPrint` functions will currently 
just segfault when passing an object that has its data on a non-CPU device. In 
python, getting a segfault while displaying the object is very annoying, and so 
we should make this at least not crash.
   
   ### What changes are included in this PR?
   
   When we detect data on a non-CPU device passed to `PrettyPrint`, we copy the 
necessary part (window size of start and end of array) to the default CPU 
device, and then use the existing print utilities as is on this copied subset.
   
   Note that with the current version for nested data we might still be copying 
too much data (e.g. for a list array, there is also a `container_window` to 
limit the number of elements to show in a single element).
   
   For now just testing with Array, need to generalize to the other objects 
(ChunkedArray, RecordBatch, Table).
   
   ### Are these changes tested?
   
   TODO
   
   ### Are there any user-facing changes?
   
   No


-- 
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]

Reply via email to