Skip to content

Commit

Permalink
Added memory test on the python side
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Dec 1, 2020
1 parent 34c0753 commit faabc3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust/arrow-pyarrow-integration-testing/tests/test_sql.py
Expand Up @@ -40,12 +40,16 @@ 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())

def test_string_python(self):
"""
Expand Down

0 comments on commit faabc3d

Please sign in to comment.