Register a nullary scalar function.
()
| 201 | |
| 202 | @pytest.fixture(scope="session") |
| 203 | def nullary_func_fixture(): |
| 204 | """ |
| 205 | Register a nullary scalar function. |
| 206 | """ |
| 207 | def nullary_func(context): |
| 208 | return pa.array([42] * context.batch_length, type=pa.int64(), |
| 209 | memory_pool=context.memory_pool) |
| 210 | |
| 211 | func_doc = { |
| 212 | "summary": "random function", |
| 213 | "description": "generates a random value" |
| 214 | } |
| 215 | func_name = "test_nullary_func" |
| 216 | pc.register_scalar_function(nullary_func, |
| 217 | func_name, |
| 218 | func_doc, |
| 219 | {}, |
| 220 | pa.int64()) |
| 221 | |
| 222 | return nullary_func, func_name |
| 223 | |
| 224 | |
| 225 | @pytest.fixture(scope="session") |
nothing calls this directly
no outgoing calls
no test coverage detected