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

Function unary_vector_func_fixture

python/pyarrow/tests/test_udf.py:331–344  ·  view source on GitHub ↗

Register a vector function

()

Source from the content-addressed store, hash-verified

329
330@pytest.fixture(scope="session")
331def unary_vector_func_fixture():
332 """
333 Register a vector function
334 """
335 def pct_rank(ctx, x):
336 # copy here to get around pandas 1.0 issue
337 return pa.array(x.to_pandas().copy().rank(pct=True))
338
339 func_name = "y=pct_rank(x)"
340 doc = empty_udf_doc
341 pc.register_vector_function(pct_rank, func_name, doc, {
342 'x': pa.float64()}, pa.float64())
343
344 return pct_rank, func_name
345
346
347@pytest.fixture(scope="session")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected