Accept a list of file paths, run the full pipeline on each, and return a summary of what succeeded and what failed.
(paths: list)
| 9 | |
| 10 | |
| 11 | def handle_upload(paths: list) -> dict: |
| 12 | """ |
| 13 | Accept a list of file paths, run the full pipeline on each, |
| 14 | and return a summary of what succeeded and what failed. |
| 15 | """ |
| 16 | results = batch_parse(paths) |
| 17 | succeeded = [r for r in results if r["ok"]] |
| 18 | failed = [r for r in results if not r["ok"]] |
| 19 | return { |
| 20 | "uploaded": len(succeeded), |
| 21 | "failed": len(failed), |
| 22 | "ids": [r["id"] for r in succeeded], |
| 23 | "errors": failed, |
| 24 | } |
| 25 | |
| 26 | |
| 27 | def handle_get(record_id: str) -> dict: |
nothing calls this directly
no test coverage detected