Like ``run``, but collects per-file results into a list.
(
extractor: Extractor,
gz_files: list[str],
*,
manifest: BatchManifestWriter | None = None,
batch_size: int | None = None,
jobs: int = 1,
on_start: Callable[[str], None] | None = None,
)
| 688 | |
| 689 | |
| 690 | def run_collected( |
| 691 | extractor: Extractor, |
| 692 | gz_files: list[str], |
| 693 | *, |
| 694 | manifest: BatchManifestWriter | None = None, |
| 695 | batch_size: int | None = None, |
| 696 | jobs: int = 1, |
| 697 | on_start: Callable[[str], None] | None = None, |
| 698 | ) -> tuple[BatchResult, list[ExtractionResult]]: |
| 699 | """Like ``run``, but collects per-file results into a list.""" |
| 700 | files: list[ExtractionResult] = [] |
| 701 | batch = run( |
| 702 | extractor, |
| 703 | gz_files, |
| 704 | batch_size=batch_size, |
| 705 | jobs=jobs, |
| 706 | on_start=on_start, |
| 707 | on_result=lambda _p, e: files.append(e), |
| 708 | manifest=manifest, |
| 709 | ) |
| 710 | return batch, files |
| 711 | |
| 712 | |
| 713 | def run_batch_collected( |