Browse Source

Y avait un warning au build

feature/find_holes
Figg 7 months ago
parent
commit
853dba4052
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      million/model/message.py

+ 2
- 2
million/model/message.py View File

1
 from datetime import datetime
1
 from datetime import datetime
2
 from typing import Any, List
2
 from typing import Any, List
3
 from uuid import uuid4
3
 from uuid import uuid4
4
-from pydantic import BaseModel, Field, PrivateAttr, computed_field, validator
4
+from pydantic import BaseModel, Field, PrivateAttr, computed_field, field_validator
5
 
5
 
6
 
6
 
7
 class Reaction(BaseModel):
7
 class Reaction(BaseModel):
67
     def item_id(self) -> str:
67
     def item_id(self) -> str:
68
         return self._id
68
         return self._id
69
 
69
 
70
-    @validator("date_time", pre=True, always=True)
70
+    @field_validator("date_time")
71
     def parse_timestamp(cls, v):
71
     def parse_timestamp(cls, v):
72
         if isinstance(v, int):
72
         if isinstance(v, int):
73
             return datetime.fromtimestamp(v / 1000)
73
             return datetime.fromtimestamp(v / 1000)

Loading…
Cancel
Save