Skip to content

Commit

Permalink
Better error message to pinpoint already prepared datasets in the wro…
Browse files Browse the repository at this point in the history
…ng format.

PiperOrigin-RevId: 655586730
  • Loading branch information
marcenacp authored and The TensorFlow Datasets Authors committed Jul 24, 2024
1 parent a099c59 commit 2f0e2f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tensorflow_datasets/core/dataset_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,12 @@ def as_data_source(
[f.value for f in random_access_formats]
)
unsupported_format_msg = (
f"Random access data source for file format {info.file_format} is"
" not supported. Can you try to run download_and_prepare with"
f" file_format set to one of: {random_access_formats_msg}?"
f"Random access data source for file format {info.file_format} is not"
" supported. Possible root causes:\n\t* You have to run"
" download_and_prepare with"
f" file_format={random_access_formats_msg}.\n\t* The dataset is already"
f" prepared at {self.data_dir} in the {info.file_format} format. Either"
" choose another data_dir or delete the data."
)

if info.file_format is None and not info.alternative_file_formats:
Expand Down

0 comments on commit 2f0e2f3

Please sign in to comment.