(dummy_value: Any)
| 312 | """Writes a PCollection of examples to a file.""" |
| 313 | |
| 314 | def write_examples(dummy_value: Any) -> tuple[int, int]: |
| 315 | # The dummy value is needed to make the pipeline work with |
| 316 | # `beam.Create([None])`. |
| 317 | del dummy_value |
| 318 | num_examples = self.write(examples=example_gen(), path=path) |
| 319 | return shard_index, num_examples |
| 320 | |
| 321 | return ( |
| 322 | pipeline |