| 465 | |
| 466 | |
| 467 | def 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 | |
| 485 | def test_schema_hash_metadata(): |