Skip to content

Commit

Permalink
missing property
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Nov 10, 2023
1 parent 7d2db62 commit da1987a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/src/nanoarrow/_lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ cdef class Device:
def device_type(self):
return self._ptr.device_type

@property
def device_id(self):
return self._ptr.device_id

@staticmethod
def resolve(ArrowDeviceType device_type, int64_t device_id):
if device_type == ARROW_DEVICE_CPU:
Expand Down
1 change: 1 addition & 0 deletions python/tests/test_nanoarrow_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
def test_cpu_device():
cpu = na._lib.Device.cpu()
assert cpu.device_type == 1
assert cpu.device_id == 0

cpu = na._lib.Device.resolve(1, 0)
assert cpu.device_type == 1
Expand Down

0 comments on commit da1987a

Please sign in to comment.