Skip to content

Commit

Permalink
Add docstrings for ArtifactLoader values (#1179)
Browse files Browse the repository at this point in the history
**Pull Request Checklist**
- [x] Fixes doc string for ArtifactLoaders
- [ ] ~Tests added~
- [x] Documentation/examples added
- [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR
title

**Description of PR**
When trying to use `ArtifactLoaders` I found it hard to remember what
`json` and `file` actually do, and what type the variable type should
be. This PR adds docstrings which help when you're writing the
annotation.

Signed-off-by: Elliot Gunton <[email protected]>
  • Loading branch information
elliotgunton authored Aug 28, 2024
1 parent 44aa480 commit c4dd936
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hera/workflows/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ class ArtifactLoader(Enum):
"""Enum for artifact loader options."""

json = "json"
"""Deserialize the JSON-string Artifact file to a Python object (the target variable can be any JSON-compatible type)."""

file = "file"
"""Read the contents of the Artifact file directly as a string (the target variable must be a `str` type)."""


class Artifact(BaseModel):
Expand Down

0 comments on commit c4dd936

Please sign in to comment.