MCPcopy Create free account
hub / github.com/apache/arrow / test_object_leak_in_numpy_array

Function test_object_leak_in_numpy_array

python/pyarrow/tests/test_pandas.py:3985–3994  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3983
3984
3985def test_object_leak_in_numpy_array():
3986 # ARROW-6876
3987 arr = pa.array([{'a': 1}])
3988 np_arr = arr.to_pandas()
3989 assert np_arr.dtype == np.dtype('object')
3990 obj = np_arr[0]
3991 refcount = sys.getrefcount(obj)
3992 assert sys.getrefcount(obj) == refcount
3993 del np_arr
3994 assert sys.getrefcount(obj) == refcount - 1
3995
3996
3997def test_object_leak_in_dataframe():

Callers

nothing calls this directly

Calls 2

dtypeMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected