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

Function test_schema_set_field

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

Source from the content-addressed store, hash-verified

465
466
467def test_schema_set_field():
468 fields = [
469 pa.field('foo', pa.int32()),
470 pa.field('bar', pa.string()),
471 pa.field('baz', pa.list_(pa.int8()))
472 ]
473 s1 = pa.schema(fields)
474
475 s2 = s1.set(0, s1.field(0).with_type(pa.int64()))
476
477 assert s2.field(0).type == pa.int64()
478 assert s1.field(0).type == pa.int32()
479
480 s3 = s2.set(0, s2.field(0).with_nullable(False))
481 assert s2.field(0).nullable is True
482 assert s3.field(0).nullable is False
483
484
485def 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