MCPcopy Create free account
hub / github.com/apache/arrow / test_thrift_size_limits

Function test_thrift_size_limits

python/pyarrow/tests/parquet/test_basic.py:910–934  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

908
909
910def 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
937def test_schema_depth_limit(tempdir):

Callers

nothing calls this directly

Calls 4

listFunction · 0.85
arrayMethod · 0.45
write_tableMethod · 0.45
read_tableMethod · 0.45

Tested by

no test coverage detected