Skip to content

Commit

Permalink
Add log message when dynamically importing dataset
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 347153499
  • Loading branch information
Conchylicultor authored and copybara-github committed Dec 12, 2020
1 parent 4b32363 commit 3c4906e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow_datasets/scripts/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def _get_builder_cls(
# 1st case: Requested dataset is a path to `.py` script
path = _search_script_path(ds_to_build)
if path is not None:
logging.info(f'Loading dataset {ds_to_build} from path: {path}')
# Dynamically load user dataset script
with tfds.core.utils.add_sys_path(path.parent):
builder_cls = tfds.core.community.builder_cls_from_module(path.stem)
Expand All @@ -265,6 +266,9 @@ def _get_builder_cls(
extract_name_and_kwargs = tfds.core.naming.dataset_name_and_kwargs_from_name_str
builder_name, builder_kwargs = extract_name_and_kwargs(ds_to_build)
builder_cls = tfds.builder_cls(builder_name)
logging.info(
f'Loading dataset {ds_to_build} from imports: {builder_cls.__module__}'
)
builder_kwargs = typing.cast(Dict[str, str], builder_kwargs)
return builder_cls, builder_kwargs

Expand Down

0 comments on commit 3c4906e

Please sign in to comment.