From a8057001f930fcc9c1762aae8916e7c7ff32c104 Mon Sep 17 00:00:00 2001 From: Ashraf Chowdury <87828904+ashrafchowdury@users.noreply.github.com> Date: Tue, 30 Dec 2025 21:32:05 +0600 Subject: [PATCH] fix: clarify missing query filter message --- api/oss/src/core/evaluations/service.py | 6 ++++++ .../onlineEvaluation/OnlineEvaluationDrawer.tsx | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/api/oss/src/core/evaluations/service.py b/api/oss/src/core/evaluations/service.py index 4aa2111808..9e24f3208d 100644 --- a/api/oss/src/core/evaluations/service.py +++ b/api/oss/src/core/evaluations/service.py @@ -1338,6 +1338,12 @@ async def create( log.info("[EVAL] [failure] missing simple evaluation data") return None + if evaluation.flags.is_live and not evaluation.data.query_steps: + log.info( + "[EVAL] [failure] missing query for live evaluation (query_steps required)" + ) + return None + # ---------------------------------------------------------------------- log.info("[EVAL] [create]") log.info("[EVAL] [scope] ", project_id=project_id, user_id=user_id) diff --git a/web/oss/src/components/pages/evaluations/onlineEvaluation/OnlineEvaluationDrawer.tsx b/web/oss/src/components/pages/evaluations/onlineEvaluation/OnlineEvaluationDrawer.tsx index 4bbb698d46..258391228b 100644 --- a/web/oss/src/components/pages/evaluations/onlineEvaluation/OnlineEvaluationDrawer.tsx +++ b/web/oss/src/components/pages/evaluations/onlineEvaluation/OnlineEvaluationDrawer.tsx @@ -289,7 +289,10 @@ const OnlineEvaluationDrawer = ({open, onClose, onCreate}: OnlineEvaluationDrawe const queryResponse = await createSimpleQuery({query: queryPayload}) const queryId = queryResponse.query?.id if (!queryId) { - throw new Error("Unable to create query for online evaluation.") + message.error( + "Unable to create the query required for live evaluation. Please add at least one query filter and try again.", + ) + return } const revisionResponse = await retrieveQueryRevision({ @@ -297,7 +300,10 @@ const OnlineEvaluationDrawer = ({open, onClose, onCreate}: OnlineEvaluationDrawe }) const queryRevisionId = revisionResponse.query_revision?.id if (!queryRevisionId) { - throw new Error("Unable to resolve query revision for online evaluation.") + message.error( + "Unable to resolve the query revision required for live evaluation. Please try again.", + ) + return } // Prefer preview evaluator artifact id; fall back to selected config id if preview not available