Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions backend/qualibrate_app/api/routes/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from qualibrate_app.api.core.utils.request_utils import get_runner_config
from qualibrate_app.api.core.utils.types_parsing import types_conversion
from qualibrate_app.api.dependencies.search import get_search_path
from qualibrate_app.api.exceptions.classes.base import QualibrateException
from qualibrate_app.api.routes.utils.dependencies import (
get_snapshot_load_type_flag,
)
Expand Down Expand Up @@ -91,8 +92,11 @@ def get_history(
def compare_by_id(
id_to_compare: IdType,
snapshot: Annotated[SnapshotBase, Depends(_get_snapshot_instance)],
) -> Mapping[str, Mapping[str, Any]]:
return snapshot.compare_by_id(id_to_compare)
) -> Mapping[str, Mapping[str, Any]] | None:
try:
return snapshot.compare_by_id(id_to_compare)
except QualibrateException:
return None


@snapshot_router.post("/update_entry")
Expand Down