Skip to content

Commit 689447f

Browse files
authored
Fix ci (#7028)
fix ci
1 parent cc6ac9e commit 689447f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/datasets/load.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def increase_load_count(name: str):
282282

283283
def _download_additional_modules(
284284
name: str, base_path: str, imports: Tuple[str, str, str, str], download_config: Optional[DownloadConfig]
285-
) -> List[Tuple[str, str]]:
285+
) -> Tuple[List[Tuple[str, str]], List[Tuple[str, str]]]:
286286
"""
287287
Download additional module for a module <name>.py at URL (or local path) <base_path>/<name>.py
288288
The imports must have been parsed first using ``get_imports``.
@@ -324,7 +324,7 @@ def _download_additional_modules(
324324
local_import_path = os.path.join(local_import_path, sub_directory)
325325
local_imports.append((import_name, local_import_path))
326326

327-
return local_imports
327+
return local_imports, library_imports
328328

329329

330330
def _check_library_imports(name: str, library_imports: List[Tuple[str, str]]) -> None:
@@ -725,7 +725,7 @@ def get_module(self) -> DatasetModule:
725725
dataset_infos_path = Path(self.path).parent / config.DATASETDICT_INFOS_FILENAME
726726
dataset_readme_path = Path(self.path).parent / config.REPOCARD_FILENAME
727727
imports = get_imports(self.path)
728-
local_imports = _download_additional_modules(
728+
local_imports, library_imports = _download_additional_modules(
729729
name=self.name,
730730
base_path=str(Path(self.path).parent),
731731
imports=imports,
@@ -764,7 +764,7 @@ def get_module(self) -> DatasetModule:
764764
" repo on your local machine. Make sure you have read the code there to avoid malicious use, then"
765765
" set the option `trust_remote_code=True` to remove this error."
766766
)
767-
_check_library_imports(name=self.name, local_imports=local_imports)
767+
_check_library_imports(name=self.name, library_imports=library_imports)
768768
module_path, hash = _load_importable_file(
769769
dynamic_modules_path=dynamic_modules_path,
770770
module_namespace="datasets",
@@ -1289,7 +1289,7 @@ def get_module(self) -> DatasetModule:
12891289
dataset_infos_path = self.download_dataset_infos_file()
12901290
dataset_readme_path = self.download_dataset_readme_file()
12911291
imports = get_imports(local_path)
1292-
local_imports = _download_additional_modules(
1292+
local_imports, library_imports = _download_additional_modules(
12931293
name=self.name,
12941294
base_path=hf_dataset_url(self.name, "", revision=self.revision),
12951295
imports=imports,
@@ -1328,7 +1328,7 @@ def get_module(self) -> DatasetModule:
13281328
" repo on your local machine. Make sure you have read the code there to avoid malicious use, then"
13291329
" set the option `trust_remote_code=True` to remove this error."
13301330
)
1331-
_check_library_imports(name=self.name, local_imports=local_imports)
1331+
_check_library_imports(name=self.name, library_imports=library_imports)
13321332
module_path, hash = _load_importable_file(
13331333
dynamic_modules_path=dynamic_modules_path,
13341334
module_namespace="datasets",

0 commit comments

Comments
 (0)