fix: message sorting in playground (#3293)
This commit is contained in:
parent
a00bbe0a84
commit
7a93a708ee
1 changed files with 8 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ from datetime import datetime, timezone
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from pydantic import field_validator, BaseModel
|
||||
from pydantic import field_serializer, field_validator, BaseModel
|
||||
from sqlmodel import JSON, Column, Field, Relationship, SQLModel
|
||||
|
||||
|
||||
|
|
@ -32,6 +32,13 @@ class VertexBuildBase(SQLModel):
|
|||
value = UUID(value)
|
||||
return value
|
||||
|
||||
@field_serializer("timestamp")
|
||||
@classmethod
|
||||
def serialize_timestamp(cls, value):
|
||||
if value.tzinfo is None:
|
||||
value = value.replace(tzinfo=timezone.utc)
|
||||
return value
|
||||
|
||||
|
||||
class VertexBuildTable(VertexBuildBase, table=True): # type: ignore
|
||||
__tablename__ = "vertex_build"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue