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

Function test_array_getitem

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

Source from the content-addressed store, hash-verified

443
444
445def test_array_getitem():
446 arr = pa.array(range(10, 15))
447 lst = arr.to_pylist()
448
449 for idx in range(-len(arr), len(arr)):
450 assert arr[idx].as_py() == lst[idx]
451 for idx in range(-2 * len(arr), -len(arr)):
452 with pytest.raises(IndexError):
453 arr[idx]
454 for idx in range(len(arr), 2 * len(arr)):
455 with pytest.raises(IndexError):
456 arr[idx]
457
458
459@pytest.mark.numpy

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
as_pyMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected