Skip to content

Commit 37437e1

Browse files
tomvdwThe TensorFlow Datasets Authors
authored andcommitted
Do not fail when metadata files already exist in the target folder
PiperOrigin-RevId: 650978926
1 parent e1e02a2 commit 37437e1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tensorflow_datasets/scripts/cli/convert_format_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ def convert_metadata(
174174
if json_file.name == constants.DATASET_INFO_FILENAME:
175175
continue
176176
out_file = out_path / json_file.name
177-
json_file.copy(out_file)
177+
if out_file.exists():
178+
logging.info(
179+
'Not copying %s because it already exists.', os.fspath(json_file)
180+
)
181+
else:
182+
json_file.copy(out_file)
178183
logging.info('Copied %s to %s', json_file, out_file)
179184

180185
# Update dataset info and store it.

0 commit comments

Comments
 (0)