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

Function nullary_func_fixture

python/pyarrow/tests/test_udf.py:203–222  ·  view source on GitHub ↗

Register a nullary scalar function.

()

Source from the content-addressed store, hash-verified

201
202@pytest.fixture(scope="session")
203def nullary_func_fixture():
204 """
205 Register a nullary scalar function.
206 """
207 def nullary_func(context):
208 return pa.array([42] * context.batch_length, type=pa.int64(),
209 memory_pool=context.memory_pool)
210
211 func_doc = {
212 "summary": "random function",
213 "description": "generates a random value"
214 }
215 func_name = "test_nullary_func"
216 pc.register_scalar_function(nullary_func,
217 func_name,
218 func_doc,
219 {},
220 pa.int64())
221
222 return nullary_func, func_name
223
224
225@pytest.fixture(scope="session")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected