Skip to content

Commit

Permalink
fix get_changed_datasets for nested files
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoestq committed May 21, 2021
1 parent 6626659 commit 2c16e74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_dataset_cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def get_changed_datasets(repo_path: Path) -> List[Path]:
datasets_dir_path = repo_path / "datasets"

changed_datasets = set(
f.parent.name for f in changed_files if f.exists() and str(f.resolve()).startswith(str(datasets_dir_path))
f.resolve().relative_to(datasets_dir_path).parts[0]
for f in changed_files
if f.exists() and str(f.resolve()).startswith(str(datasets_dir_path))
)

return sorted(changed_datasets)
Expand Down

0 comments on commit 2c16e74

Please sign in to comment.