def test_primitive_rust(self): """ Rust -> Python -> Rust """ def double(array): array = array.to_pylist() return pyarrow.array([x * 2 if x is not None else None for x in array]) is_correct = arrow_pyarrow_integration_testing.double_py(double) self.assertTrue(is_correct)
def test_primitive_rust(): """ Rust -> Python -> Rust """ def double(array): array = array.to_pylist() return pa.array([x * 2 if x is not None else None for x in array]) is_correct = rust.double_py(double) assert is_correct
def test_primitive_rust(self): """ Rust -> Python -> Rust """ old_allocated = pyarrow.total_allocated_bytes() def double(array): array = array.to_pylist() return pyarrow.array([x * 2 if x is not None else None for x in array]) is_correct = arrow_pyarrow_integration_testing.double_py(double) self.assertTrue(is_correct) # No leak of C++ memory self.assertEqual(old_allocated, pyarrow.total_allocated_bytes())