(tempdir)
| 935 | |
| 936 | |
| 937 | def test_schema_depth_limit(tempdir): |
| 938 | path = tempdir / 'nested_schema.parquet' |
| 939 | |
| 940 | # A 10-level nested list. The Parquet schema nesting depth will be 22: |
| 941 | # - two levels of nesting for each Arrow list |
| 942 | # - one level for the list leaf |
| 943 | # - one level for the schema root |
| 944 | array = pa.array([[[[[[[[[[[42]]]]]]]]]]]) |
| 945 | table = pa.table([array], names=['nested_list']) |
| 946 | pq.write_table(table, path) |
| 947 | |
| 948 | with pytest.raises( |
| 949 | OSError, |
| 950 | match="Parquet schema too deeply nested"): |
| 951 | pq.read_table(path, schema_depth_limit=21) |
| 952 | |
| 953 | got = pq.read_table(path, schema_depth_limit=22) |
| 954 | assert got == table |
| 955 | got = pq.read_table(path) |
| 956 | assert got == table |
| 957 | |
| 958 | |
| 959 | def test_page_checksum_verification_write_table(tempdir): |
nothing calls this directly
no test coverage detected