| 459 | |
| 460 | |
| 461 | def 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 | |
| 479 | def test_schema_hash_metadata(): |