Skip to content

Commit

Permalink
Update dvc/repo/index.py
Browse files Browse the repository at this point in the history
Co-authored-by: Saugat Pachhai <suagatchhetri@outlook.com>
  • Loading branch information
PythonFZ and skshetry committed Apr 7, 2022
1 parent 65d935e commit 7804e65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dvc/repo/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __iter__(self) -> Iterator["Stage"]:

def __getitem__(self, item: str) -> "Stage":
"""Get a stage by its addressing attribute."""
for stage in self.stages:
for stage in self:
if stage.addressing == item:
return stage
raise KeyError(f"{item} - available stages are {self.stages}")
Expand Down

0 comments on commit 7804e65

Please sign in to comment.