From b49ec5c9180a7bfd82dd52e73a60fd546ad4dd66 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:23:22 +0200 Subject: [PATCH] use model_cosntruct --- .../src/simcore_service_autoscaling/utils/rabbitmq.py | 6 +++--- services/autoscaling/tests/unit/test_modules_dask.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/autoscaling/src/simcore_service_autoscaling/utils/rabbitmq.py b/services/autoscaling/src/simcore_service_autoscaling/utils/rabbitmq.py index 7e217503992..81781fb5346 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/utils/rabbitmq.py +++ b/services/autoscaling/src/simcore_service_autoscaling/utils/rabbitmq.py @@ -42,7 +42,7 @@ async def progress_tasks_message( async def post_task_progress_message(app: FastAPI, task: Task, progress: float) -> None: with log_catch(logger, reraise=False): simcore_label_keys = StandardSimcoreDockerLabels.from_docker_task(task) - message = ProgressRabbitMessageNode.construct( + message = ProgressRabbitMessageNode.model_construct( node_id=simcore_label_keys.node_id, user_id=simcore_label_keys.user_id, project_id=simcore_label_keys.project_id, @@ -55,7 +55,7 @@ async def post_task_progress_message(app: FastAPI, task: Task, progress: float) async def post_task_log_message(app: FastAPI, task: Task, log: str, level: int) -> None: with log_catch(logger, reraise=False): simcore_label_keys = StandardSimcoreDockerLabels.from_docker_task(task) - message = LoggerRabbitMessage.construct( + message = LoggerRabbitMessage.model_construct( node_id=simcore_label_keys.node_id, user_id=simcore_label_keys.user_id, project_id=simcore_label_keys.project_id, @@ -79,7 +79,7 @@ async def create_autoscaling_status_message( origin = f"dynamic:node_labels={app_settings.AUTOSCALING_NODES_MONITORING.NODES_MONITORING_NODE_LABELS}" elif app_settings.AUTOSCALING_DASK: origin = f"computational:scheduler_url={app_settings.AUTOSCALING_DASK.DASK_MONITORING_URL}" - return RabbitAutoscalingStatusMessage.construct( + return RabbitAutoscalingStatusMessage.model_construct( origin=origin, nodes_total=len(cluster.active_nodes) + len(cluster.drained_nodes) diff --git a/services/autoscaling/tests/unit/test_modules_dask.py b/services/autoscaling/tests/unit/test_modules_dask.py index 42c05247229..ae2ed0c5f15 100644 --- a/services/autoscaling/tests/unit/test_modules_dask.py +++ b/services/autoscaling/tests/unit/test_modules_dask.py @@ -42,7 +42,7 @@ _authentication_types = [ NoAuthentication(), - TLSAuthentication.construct( + TLSAuthentication.model_construct( **TLSAuthentication.model_config["json_schema_extra"]["examples"][0] ), ]