()
| 3888 | |
| 3889 | |
| 3890 | def test_singleton_blocks_zero_copy(): |
| 3891 | # Part of ARROW-3789 |
| 3892 | t = pa.table([pa.array(np.arange(1000, dtype=np.int64))], ['f0']) |
| 3893 | |
| 3894 | # Zero copy if split_blocks=True |
| 3895 | _check_to_pandas_memory_unchanged(t, split_blocks=True) |
| 3896 | |
| 3897 | prior_allocation = pa.total_allocated_bytes() |
| 3898 | result = t.to_pandas() |
| 3899 | # access private `_values` because the public `values` is made read-only by pandas |
| 3900 | assert result['f0']._values.flags.writeable |
| 3901 | assert pa.total_allocated_bytes() > prior_allocation |
| 3902 | |
| 3903 | |
| 3904 | def _check_to_pandas_memory_unchanged(obj, **kwargs): |
nothing calls this directly
no test coverage detected