()
| 3995 | |
| 3996 | |
| 3997 | def 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 | # ---------------------------------------------------------------------- |