Skip to content

Commit 0681310

Browse files
fix deprecated
1 parent 189d84c commit 0681310

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_tasks/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def _get_service_details(
8989
node.version,
9090
product_name,
9191
)
92-
obj: ServiceMetaDataPublished = ServiceMetaDataPublished.construct(
92+
obj: ServiceMetaDataPublished = ServiceMetaDataPublished.model_construct(
9393
**service_details
9494
)
9595
return obj

services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_compose_specs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def _update_container_labels(
239239
spec_service_key, default_limits
240240
)
241241

242-
label_keys = StandardSimcoreDockerLabels.construct(
242+
label_keys = StandardSimcoreDockerLabels.model_construct(
243243
user_id=user_id,
244244
project_id=project_id,
245245
node_id=node_id,

services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_event_create_sidecars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ async def action(cls, app: FastAPI, scheduler_data: SchedulerData) -> None:
254254
include=_DYNAMIC_SIDECAR_SERVICE_EXTENDABLE_SPECS,
255255
)
256256
)
257-
rabbit_message = ProgressRabbitMessageNode.construct(
257+
rabbit_message = ProgressRabbitMessageNode.model_construct(
258258
user_id=scheduler_data.user_id,
259259
project_id=scheduler_data.project_id,
260260
node_id=scheduler_data.node_uuid,
@@ -272,7 +272,7 @@ async def action(cls, app: FastAPI, scheduler_data: SchedulerData) -> None:
272272
)
273273
)
274274

275-
rabbit_message = ProgressRabbitMessageNode.construct(
275+
rabbit_message = ProgressRabbitMessageNode.model_construct(
276276
user_id=scheduler_data.user_id,
277277
project_id=scheduler_data.project_id,
278278
node_id=scheduler_data.node_uuid,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def compute_task_labels(
314314
ValidationError
315315
"""
316316
product_name = run_metadata.get("product_name", UNDEFINED_DOCKER_LABEL)
317-
standard_simcore_labels = StandardSimcoreDockerLabels.construct(
317+
standard_simcore_labels = StandardSimcoreDockerLabels.model_construct(
318318
user_id=user_id,
319319
project_id=project_id,
320320
node_id=node_id,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def publish_service_started_metrics(
3131
simcore_user_agent: str,
3232
task: CompTaskAtDB,
3333
) -> None:
34-
message = InstrumentationRabbitMessage.construct(
34+
message = InstrumentationRabbitMessage.model_construct(
3535
metrics="service_started",
3636
user_id=user_id,
3737
project_id=task.project_id,
@@ -53,7 +53,7 @@ async def publish_service_stopped_metrics(
5353
task: CompTaskAtDB,
5454
task_final_state: RunningState,
5555
) -> None:
56-
message = InstrumentationRabbitMessage.construct(
56+
message = InstrumentationRabbitMessage.model_construct(
5757
metrics="service_stopped",
5858
user_id=user_id,
5959
project_id=task.project_id,
@@ -153,7 +153,7 @@ async def publish_service_log(
153153
log: str,
154154
log_level: LogLevelInt,
155155
) -> None:
156-
message = LoggerRabbitMessage.construct(
156+
message = LoggerRabbitMessage.model_construct(
157157
user_id=user_id,
158158
project_id=project_id,
159159
node_id=node_id,
@@ -172,7 +172,7 @@ async def publish_service_progress(
172172
node_id: NodeID,
173173
progress: NonNegativeFloat,
174174
) -> None:
175-
message = ProgressRabbitMessageNode.construct(
175+
message = ProgressRabbitMessageNode.model_construct(
176176
user_id=user_id,
177177
project_id=project_id,
178178
node_id=node_id,
@@ -188,7 +188,7 @@ async def publish_project_log(
188188
log: str,
189189
log_level: LogLevelInt,
190190
) -> None:
191-
message = LoggerRabbitMessage.construct(
191+
message = LoggerRabbitMessage.model_construct(
192192
user_id=user_id,
193193
project_id=project_id,
194194
node_id=None,

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def pipeline_test_params(
476476
for x in range(_MANY_NODES)
477477
},
478478
[
479-
CompTaskAtDB.construct(
479+
CompTaskAtDB.model_construct(
480480
project_id=uuid4(),
481481
node_id=f"node_{x}",
482482
schema=NodeSchema(inputs={}, outputs={}),
@@ -493,7 +493,7 @@ def pipeline_test_params(
493493
)
494494
for x in range(_MANY_NODES)
495495
],
496-
PipelineDetails.construct(
496+
PipelineDetails.model_construct(
497497
adjacency_list={f"node_{x}": [] for x in range(_MANY_NODES)},
498498
progress=1.0,
499499
node_states={
@@ -527,7 +527,7 @@ def pipeline_test_params(
527527
},
528528
[
529529
# NOTE: we use construct here to be able to use non uuid names to simplify test setup
530-
CompTaskAtDB.construct(
530+
CompTaskAtDB.model_construct(
531531
project_id=uuid4(),
532532
node_id="node_1",
533533
schema=NodeSchema(inputs={}, outputs={}),
@@ -541,7 +541,7 @@ def pipeline_test_params(
541541
modified=datetime.datetime.now(tz=datetime.timezone.utc),
542542
last_heartbeat=None,
543543
),
544-
CompTaskAtDB.construct(
544+
CompTaskAtDB.model_construct(
545545
project_id=uuid4(),
546546
node_id="node_2",
547547
schema=NodeSchema(inputs={}, outputs={}),
@@ -555,7 +555,7 @@ def pipeline_test_params(
555555
modified=datetime.datetime.now(tz=datetime.timezone.utc),
556556
last_heartbeat=None,
557557
),
558-
CompTaskAtDB.construct(
558+
CompTaskAtDB.model_construct(
559559
project_id=uuid4(),
560560
node_id="node_3",
561561
schema=NodeSchema(inputs={}, outputs={}),
@@ -571,7 +571,7 @@ def pipeline_test_params(
571571
progress=1.00,
572572
),
573573
],
574-
PipelineDetails.construct(
574+
PipelineDetails.model_construct(
575575
adjacency_list={
576576
"node_1": ["node_2", "node_3"],
577577
"node_2": ["node_3"],
@@ -597,5 +597,6 @@ async def test_compute_pipeline_details(
597597
pipeline_test_params.comp_tasks,
598598
)
599599
assert (
600-
received_details.model_dump() == pipeline_test_params.expected_pipeline_details.model_dump()
600+
received_details.model_dump()
601+
== pipeline_test_params.expected_pipeline_details.model_dump()
601602
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def mocked_catalog_service_fcts(
179179
) -> Iterator[respx.MockRouter]:
180180
def _mocked_service_resources(request) -> httpx.Response:
181181
return httpx.Response(
182-
200, json=jsonable_encoder(fake_service_resources, by_alias=True)
182+
httpx.codes.OK, json=jsonable_encoder(fake_service_resources, by_alias=True)
183183
)
184184

185185
def _mocked_services_details(

0 commit comments

Comments
 (0)