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

Function test_schema_negative_indexing

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

Source from the content-addressed store, hash-verified

594
595
596def 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
616def test_schema_repr_with_dictionaries():

Callers

nothing calls this directly

Calls 4

equalsMethod · 0.80
fieldMethod · 0.45
stringMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected