Skip to content

Commit

Permalink
remove assert_cpu now repr work
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Jun 26, 2024
1 parent b129fdc commit 1b64ccf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions python/pyarrow/array.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,9 @@ cdef class Array(_PandasConvertible):
"""
Render a "pretty-printed" string representation of the Array.
Note: for data on a non-CPU device, the full array is copied to CPU
memory.
Parameters
----------
indent : int, default 2
Expand All @@ -1261,8 +1264,6 @@ cdef class Array(_PandasConvertible):
If the array should be rendered as a single line of text
or if each element should be on its own line.
"""
self._assert_cpu()

cdef:
c_string result
PrettyPrintOptions options
Expand Down
6 changes: 2 additions & 4 deletions python/pyarrow/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -4035,6 +4035,8 @@ def test_non_cpu_array():
assert arr.is_cpu is False
assert len(arr) == 4
assert arr.slice(2, 2).offset == 2
assert repr(arr)
assert str(arr)

# TODO support DLPack for CUDA
with pytest.raises(NotImplementedError):
Expand Down Expand Up @@ -4065,10 +4067,6 @@ def test_non_cpu_array():
arr.get_total_buffer_size()
with pytest.raises(NotImplementedError):
[i for i in iter(arr)]
with pytest.raises(NotImplementedError):
repr(arr)
with pytest.raises(NotImplementedError):
str(arr)
with pytest.raises(NotImplementedError):
arr == arr2
with pytest.raises(NotImplementedError):
Expand Down

0 comments on commit 1b64ccf

Please sign in to comment.