You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GET /api/notebooks/{id} returns 500 for an id without the table prefix #1452
GET /api/notebooks/abc123 (no notebook: prefix) returns 500: invalid string provided for parse. the expected string format is "table_name:record_id". The other single-record endpoints handle the same input: GET /api/sources/abc123, /api/notes/abc123 and /api/transformations/abc123 return 400, and /api/episode-profiles/abc123 returns 404.
The UI always sends the prefixed id, so this only affects API clients and hand-typed URLs.
Expected outcome
get_notebook (api/routers/notebooks.py) either normalizes a bare id to notebook:<id> or returns 400, consistent with sources/notes. A well-formed id that doesn't exist stays 404.
Acceptance criteria
GET /api/notebooks/abc123 returns 400 (or resolves the prefixed id); GET /api/notebooks/notebook:missing stays 404.
Fixes an issue where GET /api/notebooks/{id} returns a 500 internal server error when an ID without the table prefix (e.g. abc123) is provided, instead of a 400 or properly handling it like other single-record endpoints.
Changes
Updated get_notebook in api/routers/notebooks.py to catch ValueError / record ID parsing errors or check/normalize the notebook ID format, returning a 400 Bad Request error when an invalid un-prefixed or malformed record ID string is supplied.
Verification
Run tests via pytest to ensure GET /api/notebooks/abc123 returns 400 and GET /api/notebooks/notebook:missing returns 404.
Activity
adityawaghamare commentedon Oct 4, 2026
Solution Summary
Summary
Fixes an issue where
GET /api/notebooks/{id}returns a 500 internal server error when an ID without the table prefix (e.g.abc123) is provided, instead of a 400 or properly handling it like other single-record endpoints.Changes
get_notebookinapi/routers/notebooks.pyto catchValueError/ record ID parsing errors or check/normalize the notebook ID format, returning a 400 Bad Request error when an invalid un-prefixed or malformed record ID string is supplied.Verification
GET /api/notebooks/abc123returns 400 andGET /api/notebooks/notebook:missingreturns 404.Closes #1452