Batch push labels from CSV/parquet upload or external systems (Argilla, Label Studio).
(request: BatchPushRequest)
| 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 |
nothing calls this directly
no test coverage detected