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
fix(predictions): allow deleting predictions imported without model_version
Issue #9717 — imported predictions whose model_version was missing could
not be deleted via DELETE /api/projects/<pk>/model-versions. Three legacy
import paths defaulted the field to the literal string 'undefined' while
other paths stored NULL, and the FE echoed those values back to a delete
endpoint that rejected anything falsy.
Backend
- Three import sites (data_import/api.py × 2, tasks/serializers.py) now
store None instead of 'undefined' when the field is missing from input.
- DELETE /api/projects/<pk>/model-versions accepts JSON null, empty
string, and the legacy 'undefined' string as "no model version" and
routes them through a single isnull-aware delete path.
- Project.delete_predictions(None) sweeps NULL / '' / 'undefined' together
so callers do not have to know about the pre-migration data layout.
- Migration tasks/0062 backfills 'undefined' rows to NULL.
Frontend
- PredictionsList renders "No model version" with an explanatory tooltip
for falsy and legacy-'undefined' values; the stale === "undefined"
comparison is gone.
Tests
- projects/tests/test_api.py adds TestDeletePredictionsAPI covering
specific version, JSON null, empty string, legacy 'undefined', mixed
null-ish sweep, and missing-key 400.
Related: review of upstream PR #9735.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments