Skip to content

Commit

Permalink
fix: missing eager load to row (#2239) (#2244)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyujin Cho <kyujin.cho@lablup.com>
Backported-from: main (24.09)
Backported-to: 24.03
Backport-of: 2239
  • Loading branch information
lablup-octodog and kyujin-cho authored Jun 2, 2024
1 parent f2dd72f commit 4385a73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ai/backend/manager/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ async def mutate(
client_role = ctx.user["role"]

async with ctx.db.begin_readonly_session() as session:
image_row = await ImageRow.get(session, _image_id)
image_row = await ImageRow.get(session, _image_id, load_aliases=True)
if not image_row:
raise ImageNotFound
if client_role != UserRole.SUPERADMIN:
Expand Down
2 changes: 1 addition & 1 deletion src/ai/backend/manager/models/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ async def load_slice(
.where(KernelRow.session_id == session_id)
.limit(limit)
.offset(offset)
.options(selectinload(KernelRow.image_row))
.options(selectinload(KernelRow.image_row).options(selectinload(ImageRow.aliases)))
)
if cluster_role is not None:
query = query.where(KernelRow.cluster_role == cluster_role)
Expand Down

0 comments on commit 4385a73

Please sign in to comment.