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

Class MyArray

python/pyarrow/tests/test_array.py:3959–3964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3957def test_array_protocol():
3958
3959 class MyArray:
3960 def __init__(self, data):
3961 self.data = data
3962
3963 def __arrow_array__(self, type=None):
3964 return pa.array(self.data, type=type)
3965
3966 arr = MyArray(np.array([1, 2, 3], dtype='int64'))
3967 result = pa.array(arr)

Callers 1

test_array_protocolFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_array_protocolFunction · 0.68