Skip to content

Commit c5de668

Browse files
continue fixing
1 parent 488acd1 commit c5de668

File tree

14 files changed

+32
-24
lines changed

14 files changed

+32
-24
lines changed

packages/models-library/src/models_library/function_services_catalog/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
def iter_service_docker_data() -> Iterator[ServiceMetaDataPublished]:
2525
for meta_obj in catalog.iter_metadata():
2626
# NOTE: the originals are this way not modified from outside
27-
copied_meta_obj = meta_obj.copy(deep=True)
27+
copied_meta_obj = meta_obj.model_copy(deep=True)
2828
assert is_function_service(copied_meta_obj.key) # nosec
2929
yield copied_meta_obj
3030

packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def create_computation_cb(url, **kwargs) -> CallbackResult:
109109
}
110110
returned_computation = ComputationTask.model_validate(
111111
ComputationTask.model_config["json_schema_extra"]["examples"][0]
112-
).copy(
112+
).model_copy(
113113
update={
114114
"id": f"{kwargs['json']['project_id']}",
115115
"state": state,
@@ -133,7 +133,7 @@ def get_computation_cb(url, **kwargs) -> CallbackResult:
133133
node_states = FULL_PROJECT_NODE_STATES
134134
returned_computation = ComputationTask.model_validate(
135135
ComputationTask.model_config["json_schema_extra"]["examples"][0]
136-
).copy(
136+
).model_copy(
137137
update={
138138
"id": Path(url.path).name,
139139
"state": state,

packages/service-library/src/servicelib/aiohttp/db_asyncpg_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def connect_to_db(app: web.Application, settings: PostgresSettings) -> Non
4646
- sets an engine in app state (use `get_async_engine(app)` to retrieve)
4747
"""
4848
if settings.POSTGRES_CLIENT_NAME:
49-
settings = settings.copy(
49+
settings = settings.model_copy(
5050
update={"POSTGRES_CLIENT_NAME": settings.POSTGRES_CLIENT_NAME + "-asyncpg"}
5151
)
5252

services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/_base_scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ async def _get_changed_tasks_from_backend(
460460
return [
461461
(
462462
task,
463-
task.copy(update={"state": backend_state}),
463+
task.model_copy(update={"state": backend_state}),
464464
)
465465
for task, backend_state in zip(
466466
processing_tasks, tasks_backend_status, strict=True

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ async def test_mark_all_services_in_wallet_for_removal(
502502
) -> None:
503503
for wallet_id in [WalletID(1), WalletID(2)]:
504504
for _ in range(2):
505-
new_scheduler_data = scheduler_data.copy(deep=True)
505+
new_scheduler_data = scheduler_data.model_copy(deep=True)
506506
new_scheduler_data.node_uuid = faker.uuid4(cast_to=None)
507507
new_scheduler_data.service_name = ServiceName(
508508
f"fake_{new_scheduler_data.node_uuid}"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def test_get_pipeline_state_from_task_states(
265265
fake_task: CompTaskAtDB,
266266
):
267267
tasks: list[CompTaskAtDB] = [
268-
fake_task.copy(deep=True, update={"state": s}) for s in task_states
268+
fake_task.model_copy(deep=True, update={"state": s}) for s in task_states
269269
]
270270

271271
pipeline_state: RunningState = get_pipeline_state_from_task_states(tasks)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def pipeline_test_params(
428428

429429
# resolved the expected output
430430

431-
resolved_expected_pipeline_details = expected_pipeline_details_output.copy(
431+
resolved_expected_pipeline_details = expected_pipeline_details_output.model_copy(
432432
update={
433433
"adjacency_list": {
434434
NodeID(node_name_to_uuid_map[node_a]): [

services/web/server/src/simcore_service_webserver/api_keys/_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def get_or_create_api_key(
9393
api_key=api_key,
9494
api_secret=api_secret,
9595
)
96-
return ApiKeyGet.construct(
96+
return ApiKeyGet.model_construct(
9797
display_name=row.display_name, api_key=row.api_key, api_secret=row.api_secret
9898
)
9999

services/web/server/src/simcore_service_webserver/catalog/_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async def from_catalog_service_api_model(
8686

8787
if ureg and (unit_html := get_html_formatted_unit(port, ureg)):
8888
# we know data is ok since it was validated above
89-
return ServiceInputGet.construct(
89+
return ServiceInputGet.model_construct(
9090
key_id=input_key,
9191
unit_long=unit_html.long,
9292
unit_short=unit_html.short,
@@ -123,7 +123,7 @@ async def from_catalog_service_api_model(
123123
unit_html: UnitHtmlFormat | None
124124
if ureg and (unit_html := get_html_formatted_unit(port, ureg)):
125125
# we know data is ok since it was validated above
126-
return ServiceOutputGet.construct(
126+
return ServiceOutputGet.model_construct(
127127
key_id=output_key,
128128
unit_long=unit_html.long,
129129
unit_short=unit_html.short,

services/web/server/src/simcore_service_webserver/groups/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def list_all_user_groups(app: web.Application, user_id: UserID) -> list[Gr
3232
async with get_database_engine(app).acquire() as conn:
3333
groups_db = await _db.get_all_user_groups(conn, user_id=user_id)
3434

35-
return [Group.construct(**group.model_dump()) for group in groups_db]
35+
return [Group.model_construct(**group.model_dump()) for group in groups_db]
3636

3737

3838
async def get_user_group(
@@ -199,5 +199,5 @@ async def get_group_from_gid(app: web.Application, gid: GroupID) -> Group | None
199199
group_db = await _db.get_group_from_gid(conn, gid=gid)
200200

201201
if group_db:
202-
return Group.construct(**group_db.model_dump())
202+
return Group.model_construct(**group_db.model_dump())
203203
return None

0 commit comments

Comments
 (0)