Skip to content

Commit 510fb0a

Browse files
fix deprecated
1 parent de5b8d4 commit 510fb0a

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async def service_retrieve_data_on_ports(
281281
response = await services_client.request(
282282
"POST",
283283
f"{service_base_url}/retrieve",
284-
content=retrieve_settings.json(by_alias=True),
284+
content=retrieve_settings.model_dump_json(by_alias=True),
285285
timeout=timeout,
286286
)
287287

services/director-v2/tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def mock_env(
198198
async def client(mock_env: EnvVarsDict) -> AsyncIterator[TestClient]:
199199
settings = AppSettings.create_from_envs()
200200
app = init_app(settings)
201-
print("Application settings\n", settings.json(indent=2))
201+
print("Application settings\n", settings.model_dump_json(indent=2))
202202
# NOTE: this way we ensure the events are run in the application
203203
# since it starts the app on a test server
204204
with TestClient(app, raise_server_exceptions=True) as test_client:
@@ -209,7 +209,7 @@ async def client(mock_env: EnvVarsDict) -> AsyncIterator[TestClient]:
209209
async def initialized_app(mock_env: EnvVarsDict) -> AsyncIterable[FastAPI]:
210210
settings = AppSettings.create_from_envs()
211211
app = init_app(settings)
212-
print("Application settings\n", settings.json(indent=2))
212+
print("Application settings\n", settings.model_dump_json(indent=2))
213213
async with LifespanManager(app):
214214
yield app
215215

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ async def test_create_cluster(
311311
response = await async_client.post(
312312
create_cluster_url,
313313
json=json.loads(
314-
cluster_data.json(
314+
cluster_data.model_dump_json(
315315
by_alias=True,
316316
exclude_unset=True,
317317
encoder=create_json_encoder_wo_secrets(ClusterCreate),
@@ -355,7 +355,7 @@ async def test_update_own_cluster(
355355
response = await async_client.patch(
356356
f"/v2/clusters/15615165165165?user_id={user_1['id']}",
357357
json=json.loads(
358-
ClusterPatch().json(
358+
ClusterPatch().model_dump_json(
359359
**_PATCH_EXPORT, encoder=create_json_encoder_wo_secrets(ClusterPatch)
360360
)
361361
),
@@ -377,7 +377,7 @@ async def test_update_own_cluster(
377377
response = await async_client.patch(
378378
f"/v2/clusters/{the_cluster.id}?user_id={user_1['id']}",
379379
json=json.loads(
380-
ClusterPatch().json(
380+
ClusterPatch().model_dump_json(
381381
**_PATCH_EXPORT, encoder=create_json_encoder_wo_secrets(ClusterPatch)
382382
)
383383
),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _get_app(async_client: httpx.AsyncClient) -> FastAPI:
6969

7070
settings: AppSettings = app.state.settings
7171
assert settings
72-
print(settings.json(indent=1))
72+
print(settings.model_dump_json(indent=1))
7373

7474
return async_client
7575

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def test_create_dynamic_services(
343343
response = client.post(
344344
"/v2/dynamic_services",
345345
headers=dynamic_sidecar_headers,
346-
json=json.loads(post_data.json()),
346+
json=json.loads(post_data.model_dump_json()),
347347
follow_redirects=False,
348348
)
349349
assert (
@@ -555,7 +555,7 @@ def test_delete_service_waiting_for_manual_intervention(
555555
response = client.post(
556556
"/v2/dynamic_services",
557557
headers=dynamic_sidecar_headers,
558-
json=json.loads(post_data.json()),
558+
json=json.loads(post_data.model_dump_json()),
559559
)
560560
assert (
561561
response.status_code == exp_status_code

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ async def _trigger_progress_event(
598598
),
599599
)
600600
await cast(DaskScheduler, scheduler)._task_progress_change_handler( # noqa: SLF001
601-
event.json()
601+
event.model_dump_json()
602602
)
603603

604604

@@ -1021,7 +1021,7 @@ async def test_task_progress_triggers(
10211021
await cast(
10221022
DaskScheduler, scheduler
10231023
)._task_progress_change_handler( # noqa: SLF001
1024-
progress_event.json()
1024+
progress_event.model_dump_json()
10251025
)
10261026
# NOTE: not sure whether it should switch to STARTED.. it would make sense
10271027
await _assert_comp_tasks_db(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def dynamic_sidecar_service_spec(
195195
f"{to_simcore_runtime_docker_label_key('service_port')}": "80",
196196
f"{to_simcore_runtime_docker_label_key('service_key')}": "simcore/services/dynamic/3dviewer",
197197
f"{to_simcore_runtime_docker_label_key('service_version')}": "2.4.5",
198-
DYNAMIC_SIDECAR_SCHEDULER_DATA_LABEL: scheduler_data_from_http_request.json(),
198+
DYNAMIC_SIDECAR_SCHEDULER_DATA_LABEL: scheduler_data_from_http_request.model_dump_json(),
199199
},
200200
}
201201

0 commit comments

Comments
 (0)