diff --git a/dvc/repo/index.py b/dvc/repo/index.py index 8fbb18eee8..2f764a786d 100644 --- a/dvc/repo/index.py +++ b/dvc/repo/index.py @@ -359,7 +359,9 @@ def from_file(cls, repo: "Repo", path: str) -> "Index": params={path: dvcfile.params} if dvcfile.params else {}, artifacts={path: dvcfile.artifacts} if dvcfile.artifacts else {}, datasets={path: dvcfile.datasets} if dvcfile.datasets else {}, - datasets_lock={path: dvcfile.datasets_lock} if dvcfile.datasets else {}, + datasets_lock={path: dvcfile.datasets_lock} + if dvcfile.datasets_lock + else {}, ) def update(self, stages: Iterable["Stage"]) -> "Index":