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

Function test_exported_functions

python/pyarrow/tests/test_compute.py:94–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93
94def test_exported_functions():
95 # Check that all exported concrete functions can be called with
96 # the right number of arguments.
97 # Note that unregistered functions (e.g. with a mismatching name)
98 # will raise KeyError.
99 functions = exported_functions
100 assert len(functions) >= 10
101 for func in functions:
102 desc = func.__arrow_compute_function__
103 if desc['options_required']:
104 # Skip this function as it will fail with a different error
105 # message if we don't pass an options instance.
106 continue
107 arity = desc['arity']
108 if arity == 0:
109 continue
110 if arity is Ellipsis:
111 args = [object()] * 3
112 else:
113 args = [object()] * arity
114 with pytest.raises(TypeError,
115 match="Got unexpected argument type "
116 "<class 'object'> for compute function"):
117 func(*args)
118
119
120def test_hash_aggregate_not_exported():

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
funcFunction · 0.70

Tested by

no test coverage detected