Verify and enforce NOT NULL on sessions / kernels identity columns
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
Session/kernel identity columns are always populated on the creation path but are declared nullable. Verify there is no scheduling-intermediate state or legacy data that legitimately leaves them NULL, then migrate to NOT NULL.
Target columns:
- sessions.name, sessions.access_key, sessions.creation_id
- kernels.session_name, kernels.access_key, kernels.image, kernels.session_creation_id
For each column: backfill existing NULL rows, ensure an appropriate default/server default, add an Alembic migration setting NOT NULL, and update the ORM model type annotations.
JIRA Issue: BA-7220
Contributor guide
Research direction
Start by tracing the sessions and kernels creation paths and checking for scheduling-intermediate states or legacy rows with NULL identity fields. Review the ORM models and Alembic migration history, then verify that existing NULLs can be backfilled and that the migration, defaults, NOT NULL constraints, and type annotations cover all listed columns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100