Skip to content

Commit

Permalink
remove task actions (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Oct 18, 2024
1 parent ae32848 commit dad53e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions skyvern/forge/sdk/db/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1629,3 +1629,15 @@ async def get_previous_actions_for_task(self, task_id: str) -> list[Action]:
)
actions = (await session.scalars(query)).all()
return [Action.model_validate(action) for action in actions]

async def delete_task_actions(self, organization_id: str, task_id: str) -> None:
async with self.Session() as session:
# delete actions by filtering organization_id and task_id
stmt = delete(ActionModel).where(
and_(
ActionModel.organization_id == organization_id,
ActionModel.task_id == task_id,
)
)
await session.execute(stmt)
await session.commit()

0 comments on commit dad53e1

Please sign in to comment.