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

Function test_schema_set_field

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

Source from the content-addressed store, hash-verified

459
460
461def test_schema_set_field():
462 fields = [
463 pa.field('foo', pa.int32()),
464 pa.field('bar', pa.string()),
465 pa.field('baz', pa.list_(pa.int8()))
466 ]
467 s1 = pa.schema(fields)
468
469 s2 = s1.set(0, s1.field(0).with_type(pa.int64()))
470
471 assert s2.field(0).type == pa.int64()
472 assert s1.field(0).type == pa.int32()
473
474 s3 = s2.set(0, s2.field(0).with_nullable(False))
475 assert s2.field(0).nullable is True
476 assert s3.field(0).nullable is False
477
478
479def test_schema_hash_metadata():

Callers

nothing calls this directly

Calls 4

fieldMethod · 0.45
stringMethod · 0.45
schemaMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected