File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,7 +153,10 @@ def _get_builder_datadir_path(builder_cls: Type[Any]) -> epath.Path:
153153 """
154154 pkg_names = builder_cls .__module__ .split ("." )
155155 # -1 to remove the xxx.py python file.
156- return epath .resource_path (pkg_names [0 ]).joinpath (* pkg_names [1 :- 1 ])
156+ path = epath .resource_path (pkg_names [0 ])
157+ for pkg_name in pkg_names [1 :- 1 ]:
158+ path = path .joinpath (pkg_name )
159+ return path
157160
158161
159162class DatasetBuilder (registered .RegisteredDataset ):
@@ -343,7 +346,9 @@ def code_path(cls) -> epath.Path | None:
343346 or path .parts
344347 ):
345348 modules [- 1 ] += ".py"
346- return path .joinpath (* modules [1 :])
349+ for module in modules [1 :]:
350+ path = path .joinpath (module )
351+ return path
347352 # Otherwise, fallback to `pathlib.Path`. For non-zipapp, it should be
348353 # equivalent to the above return.
349354 try :
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ def tfds_path(*relative_path: epath.PathLike) -> epath.Path:
4747 Returns:
4848 path: The root TFDS path.
4949 """
50- return root_tfds_path ().joinpath (* relative_path )
50+ path = root_tfds_path ()
51+ for pkg_name in relative_path :
52+ path = path .joinpath (pkg_name )
53+ return path
5154
5255
5356def tfds_write_path (* relative_path : epath .PathLike ) -> epath .Path :
You can’t perform that action at this time.
0 commit comments