|
1 | 1 | import datetime as dt |
2 | 2 | from contextlib import suppress |
3 | | -from typing import Annotated, Any |
| 3 | +from typing import Any |
4 | 4 |
|
5 | | -from common_library.pydantic_validators import validate_legacy_datetime_str |
6 | 5 | from dask_task_models_library.container_tasks.protocol import ContainerEnvsDict |
7 | 6 | from models_library.api_schemas_directorv2.services import NodeRequirements |
8 | 7 | from models_library.basic_regex import SIMPLE_VERSION_RE |
|
17 | 16 | from models_library.services_resources import BootMode |
18 | 17 | from pydantic import ( |
19 | 18 | BaseModel, |
20 | | - BeforeValidator, |
21 | 19 | ByteSize, |
22 | 20 | ConfigDict, |
23 | 21 | Field, |
@@ -146,8 +144,8 @@ class CompTaskAtDB(BaseModel): |
146 | 144 | last_heartbeat: dt.datetime | None = Field( |
147 | 145 | ..., description="Last time the running task was checked by the backend" |
148 | 146 | ) |
149 | | - created: Annotated[dt.datetime, BeforeValidator(validate_legacy_datetime_str)] |
150 | | - modified: Annotated[dt.datetime, BeforeValidator(validate_legacy_datetime_str)] |
| 147 | + created: dt.datetime |
| 148 | + modified: dt.datetime |
151 | 149 | # Additional information about price and hardware (ex. AWS EC2 instance type) |
152 | 150 | pricing_info: dict | None |
153 | 151 | hardware_info: HardwareInfo |
@@ -234,8 +232,8 @@ def to_db_model(self, **exclusion_rules) -> dict[str, Any]: |
234 | 232 | "state": "NOT_STARTED", |
235 | 233 | "progress": 0.44, |
236 | 234 | "last_heartbeat": None, |
237 | | - "created": "2022-05-20 13:28:31.139+00", |
238 | | - "modified": "2023-06-23 15:58:32.833081+00", |
| 235 | + "created": "2022-05-20 13:28:31.139", |
| 236 | + "modified": "2023-06-23 15:58:32.833081", |
239 | 237 | "pricing_info": { |
240 | 238 | "pricing_plan_id": 1, |
241 | 239 | "pricing_unit_id": 1, |
|
0 commit comments