Skip to content

Commit

Permalink
Add missing join in test_assign_and_unsassign_sandbox_to_jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Jun 9, 2024
1 parent c48350a commit ea02d7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions diracx-db/src/diracx/db/sql/sandbox_metadata/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ async def unassign_sandboxes_to_jobs(self, jobs_ids: list[int]) -> None:
"""Delete mapping between jobs and sandboxes"""
for job_id in jobs_ids:
entity_id = self.jobid_to_entity_id(job_id)
sb_sel_stmt = sqlalchemy.select(
sb_SandBoxes.SBId,
).where(sb_EntityMapping.EntityId == entity_id)
sb_sel_stmt = sqlalchemy.select(sb_SandBoxes.SBId)
sb_sel_stmt = sb_sel_stmt.join(
sb_EntityMapping, sb_EntityMapping.SBId == sb_SandBoxes.SBId
)
sb_sel_stmt = sb_sel_stmt.where(sb_EntityMapping.EntityId == entity_id)

result = await self.conn.execute(sb_sel_stmt)
sb_ids = [row.SBId for row in result]
Expand Down

0 comments on commit ea02d7c

Please sign in to comment.