Skip to content

Commit e1faa99

Browse files
ChaoPangCopilot
andauthored
Update src/cehrbert/data_generators/hf_data_generator/cache_util.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ed00876 commit e1faa99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cehrbert/data_generators/hf_data_generator/cache_util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def get_dataset_version_folder(file_name: str) -> Optional[str]:
3030
found_dataset_folder = True
3131
break
3232
parents.append(str(p))
33-
assert len(parents) >= 2, f"the number of parents must be greater and equal than 2 for {file_name}"
33+
if len(parents) < 2:
34+
LOG.warning(f"the number of parents is less than 2 for {file_name}")
35+
return None
3436
if (parents[-1].endswith("generator") or parents[-1].endswith("parquet")) and found_dataset_folder:
3537
return parents[-2]
3638
return None

0 commit comments

Comments
 (0)