Skip to content

Commit 7314218

Browse files
committed
fix: Fix enum str representation
1 parent 7b2ee40 commit 7314218

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

spark8t/cli/service_account_registry.py

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ class Actions(str, Enum):
5353
PRIMARY = "get-primary"
5454
LIST = "list"
5555

56+
def __str__(self) -> str:
57+
"""Define string representation.
58+
59+
TODO(py310): replace inheritance with StrEnum once we drop py310
60+
"""
61+
return str.__str__(self)
62+
5663

5764
def create_namespace_if_missing(kube_interface: AbstractKubeInterface, namespace: str):
5865
"""Create namespace if does not exist."""

spark8t/domain.py

+7
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,10 @@ class KubernetesResourceType(str, Enum):
352352
SECRET = "secret"
353353
SECRET_GENERIC = "secret generic"
354354
NAMESPACE = "namespace"
355+
356+
def __str__(self) -> str:
357+
"""Define string representation.
358+
359+
TODO(py310): replace inheritance with StrEnum once we drop py310
360+
"""
361+
return str.__str__(self)

spark8t/services.py

+7
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,13 @@ class SparkDeployMode(str, Enum):
15961596
CLIENT = "client"
15971597
CLUSTER = "cluster"
15981598

1599+
def __str__(self) -> str:
1600+
"""Define string representation.
1601+
1602+
TODO(py310): replace inheritance with StrEnum once we drop py310
1603+
"""
1604+
return str.__str__(self)
1605+
15991606

16001607
class SparkInterface(WithLogging):
16011608
"""Class for providing interfaces for spark commands."""

0 commit comments

Comments
 (0)