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

Function test_recordbatch_select_column

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

Source from the content-addressed store, hash-verified

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