fix: remove truncate to save data on DB (#4025)
🔧 (model.py): Remove unused imports and functions related to truncating long strings in database models to clean up the code and improve readability.
This commit is contained in:
parent
54dd81a681
commit
b10708194b
2 changed files with 1 additions and 17 deletions
|
|
@ -2,14 +2,12 @@ from datetime import datetime, timezone
|
|||
from typing import TYPE_CHECKING
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from pydantic import field_serializer, field_validator
|
||||
from pydantic import field_validator
|
||||
from sqlmodel import JSON, Column, Field, Relationship, SQLModel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langflow.services.database.models.flow.model import Flow
|
||||
|
||||
from langflow.utils.util_strings import truncate_long_strings
|
||||
|
||||
|
||||
class TransactionBase(SQLModel):
|
||||
timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
|
|
@ -34,10 +32,6 @@ class TransactionBase(SQLModel):
|
|||
value = UUID(value)
|
||||
return value
|
||||
|
||||
@field_serializer("outputs")
|
||||
def serialize_outputs(self, data) -> dict:
|
||||
return truncate_long_strings(data)
|
||||
|
||||
|
||||
class TransactionTable(TransactionBase, table=True): # type: ignore
|
||||
__tablename__ = "transaction"
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ from sqlmodel import JSON, Column, Field, Relationship, SQLModel
|
|||
if TYPE_CHECKING:
|
||||
from langflow.services.database.models.flow.model import Flow
|
||||
|
||||
from langflow.utils.util_strings import truncate_long_strings
|
||||
|
||||
|
||||
class VertexBuildBase(SQLModel):
|
||||
timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
|
|
@ -40,14 +38,6 @@ class VertexBuildBase(SQLModel):
|
|||
value = value.replace(tzinfo=timezone.utc)
|
||||
return value
|
||||
|
||||
@field_serializer("data")
|
||||
def serialize_data(self, data: dict) -> dict:
|
||||
return truncate_long_strings(data)
|
||||
|
||||
@field_serializer("artifacts")
|
||||
def serialize_artifacts(self, data) -> dict:
|
||||
return truncate_long_strings(data)
|
||||
|
||||
|
||||
class VertexBuildTable(VertexBuildBase, table=True): # type: ignore
|
||||
__tablename__ = "vertex_build"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue