(tempdir)
| 908 | |
| 909 | |
| 910 | def test_thrift_size_limits(tempdir): |
| 911 | path = tempdir / 'largethrift.parquet' |
| 912 | |
| 913 | array = pa.array(list(range(10))) |
| 914 | num_cols = 1000 |
| 915 | table = pa.table( |
| 916 | [array] * num_cols, |
| 917 | names=[f'some_long_column_name_{i}' for i in range(num_cols)]) |
| 918 | pq.write_table(table, path) |
| 919 | |
| 920 | with pytest.raises( |
| 921 | OSError, |
| 922 | match="Couldn't deserialize thrift:.*Exceeded size limit"): |
| 923 | pq.read_table(path, thrift_string_size_limit=50 * num_cols) |
| 924 | with pytest.raises( |
| 925 | OSError, |
| 926 | match="Couldn't deserialize thrift:.*Exceeded size limit"): |
| 927 | pq.read_table(path, thrift_container_size_limit=num_cols) |
| 928 | |
| 929 | got = pq.read_table(path, thrift_string_size_limit=100 * num_cols) |
| 930 | assert got == table |
| 931 | got = pq.read_table(path, thrift_container_size_limit=2 * num_cols) |
| 932 | assert got == table |
| 933 | got = pq.read_table(path) |
| 934 | assert got == table |
| 935 | |
| 936 | |
| 937 | def test_schema_depth_limit(tempdir): |
nothing calls this directly
no test coverage detected