()
| 594 | |
| 595 | |
| 596 | def test_schema_negative_indexing(): |
| 597 | fields = [ |
| 598 | pa.field('foo', pa.int32()), |
| 599 | pa.field('bar', pa.string()), |
| 600 | pa.field('baz', pa.list_(pa.int8())) |
| 601 | ] |
| 602 | |
| 603 | schema = pa.schema(fields) |
| 604 | |
| 605 | assert schema[-1].equals(schema[2]) |
| 606 | assert schema[-2].equals(schema[1]) |
| 607 | assert schema[-3].equals(schema[0]) |
| 608 | |
| 609 | with pytest.raises(IndexError): |
| 610 | schema[-4] |
| 611 | |
| 612 | with pytest.raises(IndexError): |
| 613 | schema[3] |
| 614 | |
| 615 | |
| 616 | def test_schema_repr_with_dictionaries(): |