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

Function test_schema_depth_limit

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

Source from the content-addressed store, hash-verified

935
936
937def 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
959def test_page_checksum_verification_write_table(tempdir):

Callers

nothing calls this directly

Calls 3

arrayMethod · 0.45
write_tableMethod · 0.45
read_tableMethod · 0.45

Tested by

no test coverage detected