Skip to content

Commit 983cdb8

Browse files
Conchylicultorcopybara-github
authored andcommitted
Better error message for missing checksum
PiperOrigin-RevId: 282792002
1 parent 7e9ab95 commit 983cdb8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tensorflow_datasets/core/download/checksums.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,18 @@ def _get_path(dataset_name):
9191
path = _checksum_paths().get(dataset_name, None)
9292
if path:
9393
return path
94+
filename = os.path.basename(path)
9495
msg = (
95-
'No checksums file could be find for dataset {}. Please create one in '
96-
'one of:\n{}'
96+
'No checksums file `{}` could be find for dataset {}. Please '
97+
'create one in one of:\n{}'
9798
'If you are developing your own dataset outsite tfds, you can register '
9899
'your own checksums_dir with `tfds.download.add_checksums_dir('
99100
'checksum_dir)` or pass it to the download_and_prepare script with '
100101
'`--checksum_dir=`'
101-
).format(dataset_name, ''.join(['* {}\n'.format(c) for c in _CHECKSUM_DIRS]))
102+
).format(
103+
filename,
104+
dataset_name,
105+
''.join(['* {}\n'.format(c) for c in _CHECKSUM_DIRS]))
102106
raise AssertionError(msg)
103107

104108

0 commit comments

Comments
 (0)