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

Function ternary_func_fixture

python/pyarrow/tests/test_udf.py:152–173  ·  view source on GitHub ↗

Register a ternary scalar function.

()

Source from the content-addressed store, hash-verified

150
151@pytest.fixture(scope="session")
152def ternary_func_fixture():
153 """
154 Register a ternary scalar function.
155 """
156 def ternary_function(ctx, m, x, c):
157 mx = pc.call_function("multiply", [m, x],
158 memory_pool=ctx.memory_pool)
159 return pc.call_function("add", [mx, c],
160 memory_pool=ctx.memory_pool)
161 ternary_doc = {"summary": "y=mx+c",
162 "description": "find y from y = mx + c"}
163 func_name = "y=mx+c"
164 pc.register_scalar_function(ternary_function,
165 func_name,
166 ternary_doc,
167 {
168 "array1": pa.int64(),
169 "array2": pa.int64(),
170 "array3": pa.int64(),
171 },
172 pa.int64())
173 return ternary_function, func_name
174
175
176@pytest.fixture(scope="session")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected