Skip to content

Commit 50544fa

Browse files
tomvdwThe TensorFlow Datasets Authors
authored andcommitted
Reduce the number of arguments of a few functions
PiperOrigin-RevId: 644750205
1 parent d4cf9e6 commit 50544fa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tensorflow_datasets/scripts/cli/convert_format_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ def get_all_shard_instructions(
101101
info: dataset_info.DatasetInfo,
102102
out_file_format: file_adapters.FileFormat,
103103
out_path: epath.Path,
104-
in_file_adapter: Type[file_adapters.FileAdapter],
105-
out_file_adapter: Type[file_adapters.FileAdapter],
106104
) -> list[ShardInstruction]:
107105
"""Returns all shard instructions for the given dataset info."""
106+
in_file_adapter = file_adapters.ADAPTER_FOR_FORMAT[info.file_format]
107+
out_file_adapter = file_adapters.ADAPTER_FOR_FORMAT[out_file_format]
108108
shard_instructions = []
109109
for split_info in info.splits.values():
110110
shard_instructions.extend(
@@ -179,14 +179,10 @@ def _convert_dataset(
179179
out_dir.unlink(missing_ok=True)
180180
out_dir.mkdir(parents=True, exist_ok=True)
181181

182-
in_file_adapter = file_adapters.ADAPTER_FOR_FORMAT[info.file_format]
183-
out_file_adapter = file_adapters.ADAPTER_FOR_FORMAT[out_file_format]
184182
shard_instructions = get_all_shard_instructions(
185183
info=info,
186184
out_file_format=out_file_format,
187185
out_path=out_dir,
188-
in_file_adapter=in_file_adapter,
189-
out_file_adapter=out_file_adapter,
190186
)
191187

192188
if not shard_instructions:

0 commit comments

Comments
 (0)