Skip to content

Commit

Permalink
fix: correct vertex build delete function (#3289)
Browse files Browse the repository at this point in the history
* refactor: Rearrange imports for clarity and consistency.

* fix: delete now executes the sql statement correctly
  • Loading branch information
ogabrielluiz authored Aug 12, 2024
1 parent 9d8009f commit 775d659
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from uuid import UUID

from sqlalchemy.exc import IntegrityError
from sqlmodel import Session, select, col
from sqlalchemy import delete
from sqlmodel import Session, col, delete, select

from langflow.services.database.models.vertex_builds.model import VertexBuildBase, VertexBuildTable

Expand Down Expand Up @@ -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:
delete(VertexBuildTable).where(VertexBuildTable.flow.has(id=flow_id)) # type: ignore
db.exec(delete(VertexBuildTable).where(VertexBuildTable.flow_id == flow_id))
db.commit()

0 comments on commit 775d659

Please sign in to comment.