Skip to content

Commit 7d81c6b

Browse files
author
The TensorFlow Datasets Authors
committed
Use constants.METADATA_FILENAME when loading the metadata file.
PiperOrigin-RevId: 672936250
1 parent 697d2b3 commit 7d81c6b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tensorflow_datasets/core/dataset_builder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,7 @@ def _save_default_config_name(
19021902
# writing concurrently the same file
19031903
# * Config file is overwritten each time a config is generated. If the
19041904
# default config is changed, this will be updated.
1905-
config_path = config_dir / "metadata.json"
1905+
config_path = config_dir / constants.METADATA_FILENAME
19061906
with utils.incomplete_file(config_path) as tmp_config_path:
19071907
tmp_config_path.write_text(json.dumps(data))
19081908

@@ -1911,7 +1911,9 @@ def load_default_config_name(
19111911
common_dir: epath.Path,
19121912
) -> Optional[str]:
19131913
"""Load `builder_cls` metadata (common to all builder configs)."""
1914-
config_path = epath.Path(common_dir) / ".config/metadata.json"
1914+
config_path = (
1915+
epath.Path(common_dir) / f".config/{constants.METADATA_FILENAME}"
1916+
)
19151917
if not config_path.exists():
19161918
return None
19171919
data = json.loads(config_path.read_text())

0 commit comments

Comments
 (0)