diff --git a/packages/models-library/src/models_library/docker.py b/packages/models-library/src/models_library/docker.py index b16c4ae13cc..b8134b3ec73 100644 --- a/packages/models-library/src/models_library/docker.py +++ b/packages/models-library/src/models_library/docker.py @@ -75,7 +75,7 @@ def to_simcore_runtime_docker_label_key(key: str) -> DockerLabelKey: class StandardSimcoreDockerLabels(BaseModel): """ Represents the standard label on oSparc created containers (not yet services) - In order to create this object in code, please use construct() method! + In order to create this object in code, please use model_construct() method! """ user_id: UserID = Field(..., alias=f"{_SIMCORE_RUNTIME_DOCKER_LABEL_PREFIX}user-id") # type: ignore[literal-required] diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/rabbitmq.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/rabbitmq.py index f33a43d33fb..88c77c84997 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/rabbitmq.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/rabbitmq.py @@ -46,7 +46,7 @@ async def post_log_message( app: FastAPI, log: LogMessageStr, *, log_level: LogLevelInt ) -> None: app_settings: ApplicationSettings = app.state.settings - message = LoggerRabbitMessage.construct( + message = LoggerRabbitMessage.model_construct( node_id=app_settings.DY_SIDECAR_NODE_ID, user_id=app_settings.DY_SIDECAR_USER_ID, project_id=app_settings.DY_SIDECAR_PROJECT_ID, @@ -61,7 +61,7 @@ async def post_progress_message( app: FastAPI, progress_type: ProgressType, report: ProgressReport ) -> None: app_settings: ApplicationSettings = app.state.settings - message = ProgressRabbitMessageNode.construct( + message = ProgressRabbitMessageNode.model_construct( node_id=app_settings.DY_SIDECAR_NODE_ID, user_id=app_settings.DY_SIDECAR_USER_ID, project_id=app_settings.DY_SIDECAR_PROJECT_ID, diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py index 4466fc5e7de..73aa7416244 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py @@ -1,6 +1,6 @@ import asyncio import logging -from datetime import datetime, timezone +from datetime import UTC, datetime from decimal import Decimal from models_library.api_schemas_resource_usage_tracker.credit_transactions import ( @@ -41,9 +41,9 @@ async def sum_credit_transactions_and_publish_to_rabbitmq( wallet_id, ) ) - publish_message = WalletCreditsMessage.construct( + publish_message = WalletCreditsMessage.model_construct( wallet_id=wallet_id, - created_at=datetime.now(tz=timezone.utc), + created_at=datetime.now(tz=UTC), credits=wallet_total_credits.available_osparc_credits, product_name=product_name, ) diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py index 8e7719927bc..31171ea4104 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py @@ -116,7 +116,7 @@ async def list_service_runs( service_runs_api_model: list[ServiceRunGet] = [] for service in service_runs_db_model: service_runs_api_model.append( - ServiceRunGet.construct( + ServiceRunGet.model_construct( service_run_id=service.service_run_id, wallet_id=service.wallet_id, wallet_name=service.wallet_name, @@ -218,7 +218,7 @@ async def get_osparc_credits_aggregated_usages_page( output_api_model: list[OsparcCreditsAggregatedByServiceGet] = [] for item in output_list_db: output_api_model.append( - OsparcCreditsAggregatedByServiceGet.construct( + OsparcCreditsAggregatedByServiceGet.model_construct( osparc_credits=item.osparc_credits, service_key=item.service_key, running_time_in_hours=item.running_time_in_hours,