Esempio n. 1
0
  def testGetByteSize(self, array, slice_offset, slice_length, expected_size,
                      expected_sliced_size):
    # make sure the empty array case does not crash.
    array_util.GetByteSize(pa.array([], array.type))

    self.assertEqual(array_util.GetByteSize(array), expected_size)

    sliced = array.slice(slice_offset, slice_length)
    self.assertEqual(array_util.GetByteSize(sliced), expected_sliced_size)
Esempio n. 2
0
 def testUnsupported(self):
   with self.assertRaisesRegex(RuntimeError, "Unimplemented"):
     array_util.GetByteSize(pa.array([], type=pa.timestamp("s")))