Register a unary aggregate function (mean)
()
| 49 | |
| 50 | @pytest.fixture(scope="session") |
| 51 | def sum_agg_func_fixture(): |
| 52 | """ |
| 53 | Register a unary aggregate function (mean) |
| 54 | """ |
| 55 | def func(ctx, x, *args): |
| 56 | return pa.scalar(np.nansum(x)) |
| 57 | |
| 58 | func_name = "sum_udf" |
| 59 | func_doc = empty_udf_doc |
| 60 | |
| 61 | pc.register_aggregate_function(func, |
| 62 | func_name, |
| 63 | func_doc, |
| 64 | { |
| 65 | "x": pa.float64(), |
| 66 | }, |
| 67 | pa.float64() |
| 68 | ) |
| 69 | return func, func_name |
| 70 | |
| 71 | |
| 72 | @pytest.fixture(scope="session") |
nothing calls this directly
no outgoing calls
no test coverage detected