Skip to content

Commit

Permalink
Raise AttributeError on non-exist artifact (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
mutongx authored Aug 20, 2024
1 parent 70bdff0 commit 2bf2a61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions metaflow/client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,8 @@ def __init__(self, artifacts: Iterable[DataArtifact]):
self._artifacts = dict((art.id, art) for art in artifacts)

def __getattr__(self, name: str):
if name not in self._artifacts:
raise AttributeError(name)
return self._artifacts[name].data

def __contains__(self, var):
Expand Down

0 comments on commit 2bf2a61

Please sign in to comment.