Skip to content

Commit 9415df4

Browse files
committed
@GitHK review: free
1 parent ebf90db commit 9415df4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/models-library/src/models_library/projects_nodes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ class NodeState(BaseModel):
129129
)
130130

131131

132+
def _convert_old_enum_name(v) -> RunningState:
133+
if v == "FAILURE":
134+
return RunningState.FAILED
135+
return RunningState(v)
136+
137+
132138
class Node(BaseModel):
133139
key: Annotated[
134140
ServiceKey,
@@ -281,11 +287,6 @@ def _convert_empty_str_to_none(cls, v):
281287
def _convert_from_enum(cls, v):
282288
if isinstance(v, str):
283289

284-
def _convert_old_enum_name(v) -> RunningState:
285-
if v == "FAILURE":
286-
return RunningState.FAILED
287-
return RunningState(v)
288-
289290
# the old version of state was a enum of RunningState
290291
running_state_value = _convert_old_enum_name(v)
291292
return NodeState(current_status=running_state_value)

0 commit comments

Comments
 (0)