Skip to content

Commit 71d2515

Browse files
bug fix listing
1 parent e61f6bc commit 71d2515

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

services/director-v2/src/simcore_service_director_v2/api/rpc/_computations.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ async def list_computations_latest_iteration_tasks_page(
129129
comp_tasks_repo = CompTasksRepository.instance(db_engine=app.state.engine)
130130
comp_runs_repo = CompRunsRepository.instance(db_engine=app.state.engine)
131131

132-
# Get latest
133-
134132
total, comp_tasks = await comp_tasks_repo.list_computational_tasks_rpc_domain(
135133
project_ids=project_ids,
136134
offset=offset,

services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,16 @@ async def list_for_user__only_latest_iterations(
245245
]
246246
)
247247
)
248+
_latest_runs_subquery = _latest_runs.subquery().alias("latest_runs")
248249

249250
base_select_query = sa.select(
250251
*self._COMPUTATION_RUNS_RPC_GET_COLUMNS
251252
).select_from(
252-
_latest_runs.subquery().join(
253+
_latest_runs_subquery.join(
253254
comp_runs,
254255
sa.and_(
255-
comp_runs.c.project_uuid
256-
== literal_column("latest_runs.project_uuid"),
257-
comp_runs.c.iteration
258-
== literal_column("latest_runs.latest_iteration"),
256+
comp_runs.c.project_uuid == _latest_runs_subquery.c.project_uuid,
257+
comp_runs.c.iteration == _latest_runs_subquery.c.latest_iteration,
259258
),
260259
)
261260
)

0 commit comments

Comments
 (0)