Migrating from pymlup 0.3.x
pymlup 0.4.0 migrates the web layer to FastAPI 0.140.x and Pydantic v2. Public classes, CLI
commands, and endpoints (/health, /info, /predict, /docs, /openapi.json) are
unchanged. See the CHANGELOG
for the full list of changes.
Requirements
- Python 3.10+
- Pydantic v2
Python 3.8/3.9 and Pydantic v1 remain supported on the pymlup 0.3.x line.
Behavior changes
- Validation error responses follow Pydantic v2's error taxonomy. The response shape
(
{"detail": [...], "predict_id": ...}) is unchanged, buttype/msgvalues differ, e.g."value_error.missing"->"missing". - Numeric strings are not coerced automatically anymore — a
str-typed column no longer silently accepts a JSON number and converts it to a string. - Explicit null handling follows Pydantic v2 schema rules — a not required field only ever
got
default=None, never anOptional[...]type. Pydantic v1 inferred implicit optionality from that default and accepted an explicit JSONnull; Pydantic v2 does not, so sendingnullfor a not-required field now returns a 422 (omitting the key entirely still works).
Upgrade
pip install -U pymlup