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

Function test_object_leak_in_dataframe

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

Source from the content-addressed store, hash-verified

3995
3996
3997def test_object_leak_in_dataframe():
3998 # ARROW-6876
3999 arr = pa.array([{'a': 1}])
4000 table = pa.table([arr], ['f0'])
4001 col = table.to_pandas()['f0']
4002 assert col.dtype == np.dtype('object')
4003 obj = col[0]
4004 refcount = sys.getrefcount(obj)
4005 assert sys.getrefcount(obj) == refcount
4006 del col
4007 assert sys.getrefcount(obj) == refcount - 1
4008
4009
4010# ----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

dtypeMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected