Conversation
Migrates the EvaluationResult-related endpoints into the service:
- ``evaluation_result_to_dict(r)`` ORM ↔ dict serialiser.
- ``list_evaluation_results_data(session, eval_id)`` for the list
endpoint; raises ``EntityNotFoundError`` when the EvaluationSet
does not resolve.
- ``get_eval_result_with_keys(session, eval_id, result_id)`` packs
the "fetch row + cross-check eval_set ownership + extract artifact
keys" pattern shared by metrics + artifacts + delete endpoints.
Raises ``EntityNotFoundError("EvaluationResult")`` for the
combined 404 path.
- ``delete_eval_result_collect_keys`` does the DB delete in the
service; the router does the ArtifactStore cleanup post-session
(same split as ``delete_evaluation_set_collect_keys``).
- ``render_evaluation_metrics_tsv(result, aspect_codes)`` is the
TSV row generator; the router passes ``ASPECT_CAFA_CODES`` so the
service stays free of the domain layer.
Three router endpoints reduce to thin shims:
``download_evaluation_metrics``, ``download_evaluation_artifacts``,
``list_evaluation_results``, ``delete_evaluation_result``.
Sizes: annotations router 711 → 683 LOC. Local-first verified:
ruff + flake8 + mypy clean, 1160 pytest passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EvaluationResult-related endpoints (list, metrics TSV, artifacts ZIP, delete) move to the service. Router 711 → 683 LOC. Local-first: ruff/flake8/mypy clean, 1160 pytest pass.