Aggregate data. Celery equivalent: aggregate_data.delay(data, group_by, agg_field, agg_func)
(data: AggregateRequest)
| 275 | |
| 276 | @app.post("/api/data/aggregate") |
| 277 | async def aggregate_data(data: AggregateRequest): |
| 278 | """ |
| 279 | Aggregate data. |
| 280 | |
| 281 | Celery equivalent: |
| 282 | aggregate_data.delay(data, group_by, agg_field, agg_func) |
| 283 | """ |
| 284 | try: |
| 285 | client = await get_dirty_client_async() |
| 286 | result = await client.execute_async( |
| 287 | DATA_WORKER, |
| 288 | "aggregate", |
| 289 | data=data.data, |
| 290 | group_by=data.group_by, |
| 291 | agg_field=data.agg_field, |
| 292 | agg_func=data.agg_func, |
| 293 | ) |
| 294 | return result |
| 295 | except DirtyError as e: |
| 296 | raise HTTPException(status_code=500, detail=str(e)) |
| 297 | |
| 298 | |
| 299 | @app.post("/api/data/etl") |
nothing calls this directly
no test coverage detected