File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
tensorflow_datasets/scripts/cli Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ def _convert_dataset_dirs(
275
275
logging .info ('Converting %d datasets.' , len (from_to_dirs ))
276
276
277
277
found_dataset_versions : dict [epath .Path , dataset_info .DatasetInfo ] = {}
278
- for from_dir in from_to_dirs .keys ():
278
+ for from_dir , to_dir in from_to_dirs .items ():
279
279
builder = read_only_builder_lib .builder_from_directory (from_dir )
280
280
if out_file_format == builder .info .file_format :
281
281
raise ValueError (
@@ -289,14 +289,21 @@ def _convert_dataset_dirs(
289
289
' format. Overwriting the shards!' ,
290
290
out_file_format .value ,
291
291
)
292
- else :
292
+ elif from_dir == to_dir :
293
293
logging .info (
294
294
'The file format to convert to (%s) is already an alternative file'
295
295
' format of the dataset in %s. Skipping conversion.' ,
296
296
os .fspath (from_dir ),
297
297
out_file_format .value ,
298
298
)
299
299
continue
300
+ else :
301
+ logging .warning (
302
+ 'The file format to convert to (%s) is already an alternative file'
303
+ ' format, but the converted output is being written to a different'
304
+ ' folder, so the shards will be converted anyway.' ,
305
+ out_file_format .value ,
306
+ )
300
307
found_dataset_versions [from_dir ] = builder .info
301
308
302
309
convert_dataset_fn = functools .partial (
You can’t perform that action at this time.
0 commit comments