@@ -288,6 +288,8 @@ def _split_generators(
288
288
dl_manager : download .DownloadManager ,
289
289
pipeline : beam .Pipeline ,
290
290
) -> dict [splits_lib .Split , split_builder_lib .SplitGenerator ]:
291
+ del dl_manager # unused
292
+ del pipeline # unused
291
293
# If a split recordset is joined for the required record set, we generate
292
294
# splits accordingly. Otherwise, it generates a single `default` split with
293
295
# all the records.
@@ -302,7 +304,6 @@ def _split_generators(
302
304
split_key = split_reference .reference_field .references .field
303
305
return {
304
306
split [split_key ]: self ._generate_examples (
305
- pipeline = pipeline ,
306
307
filters = {
307
308
** self ._filters ,
308
309
split_reference .reference_field .id : split [split_key ],
@@ -311,21 +312,15 @@ def _split_generators(
311
312
for split in split_reference .split_record_set .data
312
313
}
313
314
else :
314
- return {
315
- 'default' : self ._generate_examples (
316
- pipeline = pipeline , filters = self ._filters
317
- )
318
- }
315
+ return {'default' : self ._generate_examples (filters = self ._filters )}
319
316
320
317
def _generate_examples (
321
318
self ,
322
- pipeline : beam .Pipeline ,
323
319
filters : dict [str , Any ],
324
320
) -> beam .PTransform :
325
321
"""Generates the examples for the given record set.
326
322
327
323
Args:
328
- pipeline: The Beam pipeline.
329
324
filters: A dict of filters to apply to the records. The keys should be
330
325
field names and the values should be the values to filter by. If a
331
326
record matches all the filters, it will be included in the dataset.
@@ -354,10 +349,12 @@ def convert_to_tfds_format(
354
349
conversion_utils .to_tfds_value (record , features ),
355
350
)
356
351
357
- return records .beam_reader (
358
- pipeline = pipeline
359
- ) | f'Convert to TFDS format for filters: { json .dumps (filters )} ' >> beam .MapTuple (
360
- convert_to_tfds_format ,
361
- features = self .info .features ,
362
- record_set_id = record_set .id ,
352
+ return (
353
+ records .beam_reader ()
354
+ | f'Convert to TFDS format for filters: { json .dumps (filters )} '
355
+ >> beam .MapTuple (
356
+ convert_to_tfds_format ,
357
+ features = self .info .features ,
358
+ record_set_id = record_set .id ,
359
+ )
363
360
)
0 commit comments