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

Function test_recordbatch_equals

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

Source from the content-addressed store, hash-verified

674
675
676def test_recordbatch_equals():
677 data1 = [
678 pa.array(range(5), type='int16'),
679 pa.array([-10, -5, 0, None, 10], type='int32')
680 ]
681 data2 = [
682 pa.array(['a', 'b', 'c']),
683 pa.array([['d'], ['e'], ['f']]),
684 ]
685 column_names = ['c0', 'c1']
686
687 batch = pa.record_batch(data1, column_names)
688 assert batch == pa.record_batch(data1, column_names)
689 assert batch.equals(pa.record_batch(data1, column_names))
690
691 assert batch != pa.record_batch(data2, column_names)
692 assert not batch.equals(pa.record_batch(data2, column_names))
693
694 batch_meta = pa.record_batch(data1, names=column_names,
695 metadata={'key': 'value'})
696 assert batch_meta.equals(batch)
697 assert not batch_meta.equals(batch, check_metadata=True)
698
699 # ARROW-8889
700 assert not batch.equals(None)
701 assert batch != "foo"
702
703
704def test_recordbatch_take():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected