MCPcopy
hub / github.com/benoitc/gunicorn / aggregate_data

Function aggregate_data

examples/celery_alternative/app.py:277–296  ·  view source on GitHub ↗

Aggregate data. Celery equivalent: aggregate_data.delay(data, group_by, agg_field, agg_func)

(data: AggregateRequest)

Source from the content-addressed store, hash-verified

275
276@app.post("/api/data/aggregate")
277async 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")

Callers

nothing calls this directly

Calls 2

get_dirty_client_asyncFunction · 0.90
execute_asyncMethod · 0.80

Tested by

no test coverage detected