(
array_factory, read_dictionary
)
| 825 | ]) |
| 826 | @pytest.mark.parametrize('read_dictionary', [False, True]) |
| 827 | def test_buffer_contents( |
| 828 | array_factory, read_dictionary |
| 829 | ): |
| 830 | # Test that null values are deterministically initialized to zero |
| 831 | # after a roundtrip through Parquet. |
| 832 | # See ARROW-8006 and ARROW-8011. |
| 833 | orig_table = pa.Table.from_pydict({"col": array_factory()}) |
| 834 | bio = io.BytesIO() |
| 835 | pq.write_table(orig_table, bio, use_dictionary=True) |
| 836 | bio.seek(0) |
| 837 | read_dictionary = ['col'] if read_dictionary else None |
| 838 | table = pq.read_table(bio, use_threads=False, |
| 839 | read_dictionary=read_dictionary) |
| 840 | |
| 841 | for col in table.columns: |
| 842 | [chunk] = col.chunks |
| 843 | buf = chunk.buffers()[1] |
| 844 | assert buf.to_pybytes() == buf.size * b"\0" |
| 845 | |
| 846 | |
| 847 | def test_parquet_compression_roundtrip(tempdir): |
nothing calls this directly
no test coverage detected