Sfoglia il codice sorgente

Y avait un warning au build

feature/find_holes
Figg 7 mesi fa
parent
commit
853dba4052
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2
    2
      million/model/message.py

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

@@ -1,7 +1,7 @@
1 1
 from datetime import datetime
2 2
 from typing import Any, List
3 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 7
 class Reaction(BaseModel):
@@ -67,7 +67,7 @@ class Message(BaseModel):
67 67
     def item_id(self) -> str:
68 68
         return self._id
69 69
 
70
-    @validator("date_time", pre=True, always=True)
70
+    @field_validator("date_time")
71 71
     def parse_timestamp(cls, v):
72 72
         if isinstance(v, int):
73 73
             return datetime.fromtimestamp(v / 1000)

Loading…
Annulla
Salva