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

Function test_schema_add_remove_metadata

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

Source from the content-addressed store, hash-verified

435
436
437def test_schema_add_remove_metadata():
438 fields = [
439 pa.field('foo', pa.int32()),
440 pa.field('bar', pa.string()),
441 pa.field('baz', pa.list_(pa.int8()))
442 ]
443
444 s1 = pa.schema(fields)
445
446 assert s1.metadata is None
447
448 metadata = {b'foo': b'bar', b'pandas': b'badger'}
449
450 s2 = s1.with_metadata(metadata)
451 assert s2.metadata == metadata
452
453 s3 = s2.remove_metadata()
454 assert s3.metadata is None
455
456 # idempotent
457 s4 = s3.remove_metadata()
458 assert s4.metadata is None
459
460
461def test_schema_set_field():

Callers

nothing calls this directly

Calls 3

fieldMethod · 0.45
stringMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected