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

Function unary_func_fixture

python/pyarrow/conftest.py:310–327  ·  view source on GitHub ↗

Register a unary scalar function.

()

Source from the content-addressed store, hash-verified

308# Define udf fixture for test_udf.py and test_substrait.py
309@pytest.fixture(scope="session")
310def unary_func_fixture():
311 """
312 Register a unary scalar function.
313 """
314 from pyarrow import compute as pc
315
316 def unary_function(ctx, x):
317 return pc.call_function("add", [x, 1],
318 memory_pool=ctx.memory_pool)
319 func_name = "y=x+1"
320 unary_doc = {"summary": "add function",
321 "description": "test add function"}
322 pc.register_scalar_function(unary_function,
323 func_name,
324 unary_doc,
325 {"array": pa.int64()},
326 pa.int64())
327 return unary_function, func_name
328
329
330@pytest.fixture(scope="session")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected