File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/models-library/src/models_library Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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+
132138class 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 )
You can’t perform that action at this time.
0 commit comments