Skip to content

Commit

Permalink
fix: Python 3.11's change to IntEnum.__str__
Browse files Browse the repository at this point in the history
Make a __str__ method for `JobStatus` which reverts back to printing out
the enum member's name.
  • Loading branch information
b-butler committed Dec 2, 2022
1 parent 44c39e9 commit 79c2e93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flow/scheduling/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def _to_group(cls, status):
except KeyError:
raise ValueError(f"No equivalent group status for {status}.")

def __str__(self):
"""Get the status name as a string."""
return self.name


class ClusterJob:
"""Class representing a cluster job."""
Expand Down

0 comments on commit 79c2e93

Please sign in to comment.