Skip to content

Commit 8950bec

Browse files
committed
this might break
1 parent cbc3924 commit 8950bec

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ class NodeState(BaseModel):
171171
),
172172
] = 0
173173

174-
lock_state: Annotated[NodeShareState, Field(description="the node's lock state")]
174+
lock_state: Annotated[
175+
NodeShareState | None, Field(description="the node's lock state")
176+
]
175177

176178
model_config = ConfigDict(
177179
extra="forbid",
@@ -329,8 +331,8 @@ class Node(BaseModel):
329331

330332
state: Annotated[
331333
NodeState | None,
332-
Field(default_factory=NodeState, description="The node's state object"),
333-
] = DEFAULT_FACTORY
334+
Field(description="The node's state object"),
335+
] = None
334336

335337
boot_options: Annotated[
336338
dict[EnvVarKey, str] | None,
@@ -357,7 +359,7 @@ def _convert_from_enum(cls, v):
357359
if isinstance(v, str):
358360
# the old version of state was a enum of RunningState
359361
running_state_value = _convert_old_enum_name(v)
360-
return NodeState(current_status=running_state_value)
362+
return NodeState(current_status=running_state_value, lock_state=None)
361363
return v
362364

363365
@staticmethod

services/director-v2/src/simcore_service_director_v2/utils/dags.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ async def compute_pipeline_details(
256256
and node_id_to_comp_task[node_id].progress is not None
257257
else None
258258
),
259+
lock_state=None,
259260
)
260261
for node_id, node_data in complete_dag.nodes.data()
261262
if node_data["node_class"] is NodeClass.COMPUTATIONAL

services/director-v2/tests/integration/01/test_computation_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ def _convert_to_pipeline_details(
433433
},
434434
currentStatus=s.get("currentStatus", RunningState.NOT_STARTED),
435435
progress=s.get("progress"),
436+
lock_state=None,
436437
)
437438
for n, s in exp_node_states.items()
438439
}

services/director-v2/tests/unit/test_utils_dags.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def pipeline_test_params(
489489
adjacency_list={f"node_{x}": [] for x in range(_MANY_NODES)},
490490
progress=1.0,
491491
node_states={
492-
f"node_{x}": NodeState(modified=True, progress=1)
492+
f"node_{x}": NodeState(modified=True, progress=1, lock_state=None)
493493
for x in range(_MANY_NODES)
494494
},
495495
),
@@ -568,9 +568,9 @@ def pipeline_test_params(
568568
},
569569
progress=0.3333333333333333,
570570
node_states={
571-
"node_1": NodeState(modified=True, progress=None),
572-
"node_2": NodeState(modified=True, progress=None),
573-
"node_3": NodeState(modified=True, progress=1),
571+
"node_1": NodeState(modified=True, progress=None, lock_state=None),
572+
"node_2": NodeState(modified=True, progress=None, lock_state=None),
573+
"node_3": NodeState(modified=True, progress=1, lock_state=None),
574574
},
575575
),
576576
id="proper dag",
@@ -653,12 +653,13 @@ async def test_compute_pipeline_details(
653653
},
654654
progress=0.0,
655655
node_states={
656-
"node_1": NodeState(modified=True, progress=None),
657-
"node_2": NodeState(modified=True, progress=None),
656+
"node_1": NodeState(modified=True, progress=None, lock_state=None),
657+
"node_2": NodeState(modified=True, progress=None, lock_state=None),
658658
"node_3": NodeState(
659659
modified=True,
660660
progress=None,
661661
current_status=RunningState.UNKNOWN,
662+
lock_state=None,
662663
),
663664
},
664665
),

services/director-v2/tests/unit/with_dbs/comp_scheduler/test_api_route_computations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ async def test_get_computation_from_not_started_computation_task(
953953
for node, next_nodes in fake_workbench_adjacency.items()
954954
if f"{t.node_id}" in next_nodes
955955
},
956+
lock_state=None,
956957
)
957958
for t in comp_tasks
958959
if t.node_class == NodeClass.COMPUTATIONAL
@@ -1025,6 +1026,7 @@ async def test_get_computation_from_published_computation_task(
10251026
if f"{t.node_id}" in next_nodes
10261027
},
10271028
progress=0,
1029+
lock_state=None,
10281030
)
10291031
for t in comp_tasks
10301032
if t.node_class == NodeClass.COMPUTATIONAL

0 commit comments

Comments
 (0)