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

Function test_recordbatch_select_column

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

Source from the content-addressed store, hash-verified

804
805
806def test_recordbatch_select_column():
807 data = [
808 pa.array(range(5)),
809 pa.array([-10, -5, 0, 5, 10]),
810 pa.array(range(5, 10))
811 ]
812 batch = pa.RecordBatch.from_arrays(data, names=('a', 'b', 'c'))
813
814 assert batch.column('a').equals(batch.column(0))
815
816 with pytest.raises(
817 KeyError, match='Field "d" does not exist in schema'):
818 batch.column('d')
819
820 with pytest.raises(TypeError):
821 batch.column(None)
822
823 with pytest.raises(IndexError):
824 batch.column(4)
825
826
827def test_recordbatch_select():

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
arrayMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected