fix: correct vertex build delete function (#3289)
* refactor: Rearrange imports for clarity and consistency. * fix: delete now executes the sql statement correctly
This commit is contained in:
parent
9d8009f2f5
commit
775d659380
1 changed files with 2 additions and 3 deletions
|
|
@ -2,8 +2,7 @@ from typing import Optional
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from sqlalchemy.exc import IntegrityError
|
from sqlalchemy.exc import IntegrityError
|
||||||
from sqlmodel import Session, select, col
|
from sqlmodel import Session, col, delete, select
|
||||||
from sqlalchemy import delete
|
|
||||||
|
|
||||||
from langflow.services.database.models.vertex_builds.model import VertexBuildBase, VertexBuildTable
|
from langflow.services.database.models.vertex_builds.model import VertexBuildBase, VertexBuildTable
|
||||||
|
|
||||||
|
|
@ -32,5 +31,5 @@ def log_vertex_build(db: Session, vertex_build: VertexBuildBase) -> VertexBuildT
|
||||||
|
|
||||||
|
|
||||||
def delete_vertex_builds_by_flow_id(db: Session, flow_id: UUID) -> None:
|
def delete_vertex_builds_by_flow_id(db: Session, flow_id: UUID) -> None:
|
||||||
delete(VertexBuildTable).where(VertexBuildTable.flow.has(id=flow_id)) # type: ignore
|
db.exec(delete(VertexBuildTable).where(VertexBuildTable.flow_id == flow_id))
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue