Skip to content

Commit

Permalink
fix: Fix enum str representation
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex committed Jan 13, 2025
1 parent 68fa4c6 commit 97181a9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spark8t/cli/service_account_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ class Actions(str, Enum):
PRIMARY = "get-primary"
LIST = "list"

def __str__(self) -> str:
"""Define string representation.
TODO(py310): replace inheritance with StrEnum once we drop py310
"""
return str.__str__(self)


def create_namespace_if_missing(kube_interface: AbstractKubeInterface, namespace: str):
"""Create namespace if does not exist."""
Expand Down
7 changes: 7 additions & 0 deletions spark8t/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,10 @@ class KubernetesResourceType(str, Enum):
SECRET = "secret"
SECRET_GENERIC = "secret generic"
NAMESPACE = "namespace"

def __str__(self) -> str:
"""Define string representation.
TODO(py310): replace inheritance with StrEnum once we drop py310
"""
return str.__str__(self)
7 changes: 7 additions & 0 deletions spark8t/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,13 @@ class SparkDeployMode(str, Enum):
CLIENT = "client"
CLUSTER = "cluster"

def __str__(self) -> str:
"""Define string representation.
TODO(py310): replace inheritance with StrEnum once we drop py310
"""
return str.__str__(self)


class SparkInterface(WithLogging):
"""Class for providing interfaces for spark commands."""
Expand Down

0 comments on commit 97181a9

Please sign in to comment.