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

Function test_array_diff

python/pyarrow/tests/test_array.py:683–709  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

681
682
683def test_array_diff():
684 # ARROW-6252
685 arr1 = pa.array(['foo'], type=pa.utf8())
686 arr2 = pa.array(['foo', 'bar', None], type=pa.utf8())
687 arr3 = pa.array([1, 2, 3])
688 arr4 = pa.array([[], [1], None], type=pa.list_(pa.int64()))
689 arr5 = pa.array([1.5, 3, 6], type=pa.float16())
690 arr6 = pa.array([1, 3], type=pa.float16())
691
692 assert arr1.diff(arr1) == ''
693 assert arr1.diff(arr2) == '''
694@@ -1, +1 @@
695+"bar"
696+null
697'''
698 assert arr1.diff(arr3).strip() == '# Array types differed: string vs int64'
699 assert arr1.diff(arr3).strip() == '# Array types differed: string vs int64'
700 assert arr1.diff(arr4).strip() == ('# Array types differed: string vs '
701 'list<item: int64>')
702 assert arr5.diff(arr5) == ''
703 assert arr5.diff(arr6) == ''&#x27;
704@@ -0, +0 @@
705-1.5
706+1
707@@ -2, +2 @@
708-6
709''&#x27;
710
711
712def test_array_iter():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected