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

Function test_schema_sizeof

python/pyarrow/tests/test_schema.py:732–744  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

730
731
732def test_schema_sizeof():
733 schema = pa.schema([
734 pa.field('foo', pa.int32()),
735 pa.field('bar', pa.string()),
736 ])
737
738 # Note: pa.schema is twice as large on 64-bit systems
739 assert sys.getsizeof(schema) > (30 if sys.maxsize > 2**32 else 15)
740
741 schema2 = schema.with_metadata({"key": "some metadata"})
742 assert sys.getsizeof(schema2) > sys.getsizeof(schema)
743 schema3 = schema.with_metadata({"key": "some more metadata"})
744 assert sys.getsizeof(schema3) > sys.getsizeof(schema2)
745
746
747def test_schema_merge():

Callers

nothing calls this directly

Calls 3

schemaMethod · 0.45
fieldMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected