Skip to content

Commit

Permalink
refactor (backend): resolve failing evaluation run
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Sep 25, 2024
1 parent 1027d18 commit d855d4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions agenta-backend/agenta_backend/services/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2683,7 +2683,7 @@ async def fetch_evaluations_by_resource(
)


async def delete_evaluations(evaluation_ids: List[str], project_id: str) -> None:
async def delete_evaluations(evaluation_ids: List[str]) -> None:
"""Delete evaluations based on the ids provided from the db.
Args:
Expand All @@ -2694,7 +2694,6 @@ async def delete_evaluations(evaluation_ids: List[str], project_id: str) -> None
async with db_engine.get_session() as session:
query = select(EvaluationDB).where(
EvaluationDB.id.in_(evaluation_ids),
EvaluationDB.project_id == uuid.UUID(project_id),
)
result = await session.execute(query)
evaluations = result.scalars().all()
Expand Down
8 changes: 3 additions & 5 deletions agenta-backend/agenta_backend/services/evaluation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,8 @@ async def create_new_evaluation(
Evaluation: The newly created evaluation.
"""

app = await db_manager.fetch_app_by_id(app_id=app_id, project_id=project_id)
testset = await db_manager.fetch_testset_by_id(
testset_id=testset_id, project_id=project_id
)
app = await db_manager.fetch_app_by_id(app_id=app_id)
testset = await db_manager.fetch_testset_by_id(testset_id=testset_id)
variant_db = await db_manager.get_app_variant_instance_by_id(
variant_id=variant_id, project_id=project_id
)
Expand Down Expand Up @@ -460,7 +458,7 @@ async def retrieve_evaluation_results(evaluation_id: str) -> List[dict]:


async def compare_evaluations_scenarios(evaluations_ids: List[str], project_id: str):
evaluation = await db_manager.fetch_evaluation_by_id(evaluations_ids[0], project_id)
evaluation = await db_manager.fetch_evaluation_by_id(evaluations_ids[0])
testset = evaluation.testset
unique_testset_datapoints = remove_duplicates(testset.csvdata)
formatted_inputs = extract_inputs_values_from_testset(unique_testset_datapoints)
Expand Down

0 comments on commit d855d4c

Please sign in to comment.