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

Function varargs_func_fixture

python/pyarrow/tests/test_udf.py:177–199  ·  view source on GitHub ↗

Register a varargs scalar function with at least two arguments.

()

Source from the content-addressed store, hash-verified

175
176@pytest.fixture(scope="session")
177def varargs_func_fixture():
178 """
179 Register a varargs scalar function with at least two arguments.
180 """
181 def varargs_function(ctx, first, *values):
182 acc = first
183 for val in values:
184 acc = pc.call_function("add", [acc, val],
185 memory_pool=ctx.memory_pool)
186 return acc
187 func_name = "z=ax+by+c"
188 varargs_doc = {"summary": "z=ax+by+c",
189 "description": "find z from z = ax + by + c"
190 }
191 pc.register_scalar_function(varargs_function,
192 func_name,
193 varargs_doc,
194 {
195 "array1": pa.int64(),
196 "array2": pa.int64(),
197 },
198 pa.int64())
199 return varargs_function, func_name
200
201
202@pytest.fixture(scope="session")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected