Skip to content

Commit 3ffeb0f

Browse files
committed
mypy
1 parent f5f4248 commit 3ffeb0f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,23 @@ class NodeState(BaseModel):
7878
description="true if the node's outputs need to be re-computed",
7979
),
8080
] = True
81+
8182
dependencies: Annotated[
8283
set[NodeID],
8384
Field(
8485
default_factory=set,
8586
description="contains the node inputs dependencies if they need to be computed first",
8687
),
8788
] = DEFAULT_FACTORY
89+
8890
current_status: Annotated[
8991
RunningState,
9092
Field(
9193
description="the node's current state",
9294
alias="currentStatus",
9395
),
9496
] = RunningState.NOT_STARTED
97+
9598
progress: Annotated[
9699
float | None,
97100
Field(
@@ -103,6 +106,7 @@ class NodeState(BaseModel):
103106

104107
model_config = ConfigDict(
105108
extra="forbid",
109+
populate_by_name=True,
106110
json_schema_extra={
107111
"examples": [
108112
{
@@ -284,7 +288,7 @@ def _convert_old_enum_name(v) -> RunningState:
284288

285289
# the old version of state was a enum of RunningState
286290
running_state_value = _convert_old_enum_name(v)
287-
return NodeState.model_validate({"currentStatus": running_state_value})
291+
return NodeState(current_status=running_state_value)
288292
return v
289293

290294
@staticmethod

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async def compute_pipeline_details(
246246
node_id: NodeState(
247247
modified=node_data.get(kNODE_MODIFIED_STATE, False),
248248
dependencies=node_data.get(kNODE_DEPENDENCIES_TO_COMPUTE, set()),
249-
currentStatus=node_id_to_comp_task[node_id].state,
249+
current_status=node_id_to_comp_task[node_id].state,
250250
progress=(
251251
node_id_to_comp_task[node_id].progress
252252
if node_id_to_comp_task[node_id].progress is not None

services/web/server/src/simcore_service_webserver/projects/_projects_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ async def update_project_node_state(
10251025
project_id=project_id,
10261026
node_id=node_id,
10271027
partial_node=PartialNode.model_construct(
1028-
state=NodeState(currentStatus=RunningState(new_state)) # type: ignore[call-arg]
1028+
state=NodeState(current_status=RunningState(new_state))
10291029
),
10301030
)
10311031

0 commit comments

Comments
 (0)