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

Function check_cython_example_module

python/pyarrow/tests/test_cython.py:68–80  ·  view source on GitHub ↗
(mod)

Source from the content-addressed store, hash-verified

66
67
68def check_cython_example_module(mod):
69 arr = pa.array([1, 2, 3])
70 assert mod.get_array_length(arr) == 3
71 with pytest.raises(TypeError, match="not an array"):
72 mod.get_array_length(None)
73
74 scal = pa.scalar(123)
75 cast_scal = mod.cast_scalar(scal, pa.utf8())
76 assert cast_scal == pa.scalar("123")
77 with pytest.raises(NotImplementedError,
78 match="Unsupported cast from int64 to list using function "
79 "cast_list"):
80 mod.cast_scalar(scal, pa.list_(pa.int64()))
81
82
83# NumPy is still a required build dependency. It is present in our

Callers 1

test_cython_apiFunction · 0.85

Calls 2

arrayMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected