Skip to content

Commit

Permalink
Minor error message update for abstract builder
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 230216825
  • Loading branch information
Conchylicultor authored and Copybara-Service committed Jan 21, 2019
1 parent 61c347b commit 1ddf26f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tensorflow_datasets/core/registered.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class DatasetNotFoundError(ValueError):
def __init__(self, name, is_abstract=False, in_development=False):
all_datasets_str = "\n\t- ".join([""] + list_builders())
if is_abstract:
error_string = ("Dataset %s not found. "
"Requesting the builder for an abstract class\n"
error_string = ("Dataset %s is an abstract class so cannot be created. "
"Please make sure to instantiate all abstract methods.\n"
"%s") % (name, _DATASET_NOT_FOUND_ERR)
elif in_development:
error_string = ("Dataset %s is under active development and is not "
Expand Down
3 changes: 1 addition & 2 deletions tensorflow_datasets/core/registered_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def test_abstract(self):
self.assertEqual(name, UnregisteredBuilder.name)
self.assertNotIn(name, registered.list_builders())

with self.assertRaisesWithPredicateMatch(
ValueError, "Requesting the builder for an abstract class"):
with self.assertRaisesWithPredicateMatch(ValueError, "an abstract class"):
registered.builder(name)

def test_in_development(self):
Expand Down

0 comments on commit 1ddf26f

Please sign in to comment.