-
-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Add GET/POST /task/list endpoint #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
PGijsbers
merged 8 commits into
openml:main
from
saathviksheerla:feat/task-list-endpoint
Mar 31, 2026
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1a507f8
feat: add GET/POST /task/list endpoint (#23)
saathviksheerla 73817ee
fix: address review comments on task list endpoint
saathviksheerla 4e9ee5d
fix: address bot review comments on tests of task list endpoint
saathviksheerla 4affe39
refactor list_tasks and add migration tests
saathviksheerla c8d96e4
Merge remote-tracking branch 'upstream/main' into feat/task-list-endp…
saathviksheerla 55a0d60
chore: resolve merge conflicts
saathviksheerla cb74d93
bot suggestions: improve tests, empty list check
saathviksheerla 2fd01f3
refactor /tasks/list endpoint and test suite based on PR review
saathviksheerla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider extracting small helper functions for IN-clause construction, range parsing, WHERE-clause assembly, dataset-status subquery, and task-enrichment to make
list_tasksshorter and easier to follow.You can keep the new behavior but reduce complexity by extracting a few focused helpers and reusing them.
1. Extract a generic
INclause builderYou repeat
",".join(...)and f-string interpolation for IDs and names. A tiny helper keeps SQL construction consistent and reduces visual noise:Usage:
This shrinks the
list_tasksbody and centralizes theIN (...)formatting.2. Split range parsing from quality SQL rendering
_quality_clausecurrently parses and renders SQL. Splitting the concerns makes both parts easier to read and test.Then a generic quality clause builder:
This leaves
list_taskswith just the high-level mapping:3. Extract WHERE-clause assembly into a helper
The top of
list_tasksbuilds many related conditions inline. Move that to a dedicated function that returns both fragments and the parameter dict:Then
list_tasksreduces to:4. Extract the dataset-status subquery
Moving the status subquery out of the main query makes the main SQL much easier to read:
Then in
list_tasks:5. Unify enrichment of
tasks(inputs/qualities/tags)You can use a generic helper for the “append or init list” pattern to avoid repetition:
Then:
And a single “ensure keys” helper:
Usage:
These extractions keep all current behavior and SQL intact, but make
list_tasksmostly a high‑level orchestration over small, single-purpose helpers, which should address the complexity concerns.