Register a vector function
()
| 329 | |
| 330 | @pytest.fixture(scope="session") |
| 331 | def 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") |
nothing calls this directly
no outgoing calls
no test coverage detected