feat(evaluation): filter evaluation runs list by dataset_id - #1136
Conversation
OpenAPI changes 🟢 1 non-breaking changeTip Safe to merge from an API-contract perspective. Full changelog ·
|
| Method | Path | Change | |
|---|---|---|---|
| 🟢 | GET |
/api/v1/evaluations |
added the new optional query request parameter dataset_id |
main ↔ b773cb41 · generated by oasdiff
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| logger.info( | ||
| f"[list_evaluation_runs] Listing evaluation runs | " | ||
| f"org_id={auth_context.organization_.id} | " | ||
| f"project_id={auth_context.project_.id} | limit={limit} | offset={offset}" | ||
| f"project_id={auth_context.project_.id} | limit={limit} | offset={offset} | " | ||
| f"dataset_id={dataset_id}" | ||
| ) |
There was a problem hiding this comment.
do we actually need these logs? I don’t think they are being tracked anymore, so we can probably clean up these unnecessary logger statements.
| f"[list_evaluation_runs] Found {len(runs)} evaluation runs | " | ||
| f"org_id={organization_id} | project_id={project_id} | " | ||
| f"dataset_id={dataset_id}" | ||
| ) |
Reviewer flagged these logs as unnecessary since they aren't tracked anymore. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🎉 This PR is included in version 1.5.0-main.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Issue
Closes #1137
Summary
GET /api/v1/evaluationsreturned every evaluation run in a project with no way to scope to a single dataset. Callers wanting one dataset's runs had to filter client-side, which is unreliable underlimit/offset— the runs they wanted might not be on the page they fetched.dataset_idquery param that filters runs to that evaluation dataset. Omitting it keeps the existing behaviour (all datasets in the project).Changes
GET /api/v1/evaluationstakesdataset_id: int | Noneas an annotated query param and logs it alongsidelimit/offset.list_evaluation_runs(app/crud/evaluations/core.py) applies thedataset_idpredicate in SQL, beforeorder_by/limit/offset, so it composes with the existingtype == TEXTfilter and pagination instead of filtering a page after the fact.dataset_idfrom another project returns no runs.list_evaluations.md) document the new param.Tests
dataset_id; no-filter returns all datasets; a dataset from another project is excluded (with a positive control in its owning project);dataset_idcomposes with the type filter and pagination ordering.Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
No migration and no schema change — this is a read-path query param only, and it is optional, so existing clients are unaffected.