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

Function test_table_get_field

python/pyarrow/tests/test_table.py:1661–1679  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1659
1660
1661def test_table_get_field():
1662 data = [
1663 pa.array(range(5)),
1664 pa.array([-10, -5, 0, 5, 10]),
1665 pa.array(range(5, 10))
1666 ]
1667 table = pa.Table.from_arrays(data, names=('a', 'b', 'c'))
1668
1669 assert table.field('a').equals(table.schema.field('a'))
1670 assert table.field(0).equals(table.schema.field('a'))
1671
1672 with pytest.raises(KeyError):
1673 table.field('d')
1674
1675 with pytest.raises(TypeError):
1676 table.field(None)
1677
1678 with pytest.raises(IndexError):
1679 table.field(4)
1680
1681
1682def test_table_select_column():

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
arrayMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected