From 79c2e9333ecbfc8e00c6aae27c21442753fd9969 Mon Sep 17 00:00:00 2001 From: Brandon Butler Date: Fri, 2 Dec 2022 11:08:03 -0500 Subject: [PATCH] fix: Python 3.11's change to IntEnum.__str__ Make a __str__ method for `JobStatus` which reverts back to printing out the enum member's name. --- flow/scheduling/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flow/scheduling/base.py b/flow/scheduling/base.py index b3ff2a4ce..c618c0ae6 100644 --- a/flow/scheduling/base.py +++ b/flow/scheduling/base.py @@ -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."""