MCPcopy
hub / github.com/feast-dev/feast / batch_push

Function batch_push

sdk/python/feast/ui_server.py:595–617  ·  view source on GitHub ↗

Batch push labels from CSV/parquet upload or external systems (Argilla, Label Studio).

(request: BatchPushRequest)

Source from the content-addressed store, hash-verified

593
594 @rest_app.post("/batch-push")
595 def batch_push(request: BatchPushRequest):
596 """Batch push labels from CSV/parquet upload or external systems (Argilla, Label Studio)."""
597 try:
598 df = pd.DataFrame(request.data)
599 to = request.to or "online"
600 if to == "online_and_offline":
601 store.push(
602 request.push_source_name,
603 df,
604 to=feast.data_source.PushMode.ONLINE_AND_OFFLINE,
605 )
606 elif to == "offline":
607 store.push(
608 request.push_source_name, df, to=feast.data_source.PushMode.OFFLINE
609 )
610 else:
611 store.push(
612 request.push_source_name, df, to=feast.data_source.PushMode.ONLINE
613 )
614 return {"status": "ok", "rows_pushed": len(df)}
615 except Exception:
616 logger.exception("Batch push failed")
617 return _safe_error_response("Batch push")
618
619 class WebhookPushRequest(BaseModel):
620 push_source_name: str

Callers

nothing calls this directly

Calls 3

_safe_error_responseFunction · 0.85
pushMethod · 0.80
exceptionMethod · 0.80

Tested by

no test coverage detected