Skip to content

Commit 491c50c

Browse files
committed
feat: ldh linking on publication; car submission only after mapping
- Only perform LDH linkage on score set publication. - Do not spawn LDH linkage after car submission. - Test improvements for score set publication; ldh linkage on publication required better handling of worker call assertions in test cases. - Test fixes for altered logic.
1 parent 9d3182a commit 491c50c

File tree

14 files changed

+465
-1280
lines changed

14 files changed

+465
-1280
lines changed

src/mavedb/lib/exceptions.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ class SubmissionEnqueueError(ValueError):
186186
pass
187187

188188

189-
class LinkingEnqueueError(ValueError):
190-
"""Raised when a linking job fails to be enqueued despite appearing as if it should have been"""
191-
192-
pass
193-
194-
195189
class UniProtIDMappingEnqueueError(Exception):
196190
"""Raised when a UniProt ID mapping job fails to be enqueued despite appearing as if it should have been"""
197191

src/mavedb/routers/score_sets.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,15 +2056,26 @@ async def publish_score_set(
20562056
db.refresh(item)
20572057

20582058
# await the insertion of this job into the worker queue, not the job itself.
2059-
job = await worker.enqueue_job("refresh_published_variants_view", correlation_id_for_context())
2060-
if job is not None:
2061-
save_to_logging_context({"worker_job_id": job.job_id})
2062-
logger.info(msg="Enqueud published variant materialized view refresh job.", extra=logging_context())
2059+
refresh_published_variants_job = await worker.enqueue_job(
2060+
"refresh_published_variants_view", correlation_id_for_context()
2061+
)
2062+
if refresh_published_variants_job is not None:
2063+
save_to_logging_context({"refresh_published_variants_job_id": refresh_published_variants_job.job_id})
2064+
logger.info(msg="Enqueued published variant materialized view refresh job.", extra=logging_context())
20632065
else:
20642066
logger.warning(
20652067
msg="Failed to enqueue published variant materialized view refresh job.", extra=logging_context()
20662068
)
20672069

2070+
submit_to_ldh_job = await worker.enqueue_job(
2071+
"submit_score_set_mappings_to_ldh", item.id, correlation_id_for_context()
2072+
)
2073+
if submit_to_ldh_job is not None:
2074+
save_to_logging_context({"submit_to_ldh_job_id": submit_to_ldh_job.job_id})
2075+
logger.info(msg="Enqueued submit score set mappings to LDH job.", extra=logging_context())
2076+
else:
2077+
logger.warning(msg="Failed to enqueue submit score set mappings to LDH job.", extra=logging_context())
2078+
20682079
enriched_experiment = enrich_experiment_with_num_score_sets(item.experiment, user_data)
20692080
return score_set.ScoreSet.model_validate(item).copy(update={"experiment": enriched_experiment})
20702081

0 commit comments

Comments
 (0)