cases / pydantic-v2-migration
pydantic-v2-migration
pydantic 1.10.13 → 2.0.0
Pydantic v2 renamed the model serialisation methods and replaced the validator decorator.
What each detector said
One row per (file, symbol) site — the unit the scorer compares on. Ground truth comes from the case's hand-written labels.
- not broken app/report.py :dict grep-baseline flagged agent · deepseek-v4-flash-free silent
The dict builtin used as a type annotation.
2 matched lines · reasoning
4 def summarize(rows: list[dict]) -> str: 5 # `.dict()` never appears here; a raw dict literal is not a pydantic call.
grep-baseline conf 0.50'BaseModel.dict' is named in the release notes and appears in 9 place(s) in this repo. No check was made that these are real call sites.
- unlabeled app/report.py :json grep-baseline flagged agent · deepseek-v4-flash-free silent
2 matched lines · reasoning
1 import json 7 return json.dumps(totals)
grep-baseline conf 0.50'BaseModel.json' is named in the release notes and appears in 2 place(s) in this repo. No check was made that these are real call sites.
- unlabeled app/schemas/user.py :field_validator grep-baseline flagged agent · deepseek-v4-flash-free silent
1 matched line · reasoning
8 # @validator was replaced by @field_validator in Pydantic v2.
grep-baseline conf 0.50'field_validator' is named in the release notes and appears in 1 place(s) in this repo. No check was made that these are real call sites.
- unlabeled app/schemas/user.py :model_dump grep-baseline flagged agent · deepseek-v4-flash-free silent
1 matched line · reasoning
17 # BaseModel.dict() was renamed to model_dump() in v2.
grep-baseline conf 0.50'BaseModel.model_dump' is named in the release notes and appears in 1 place(s) in this repo. No check was made that these are real call sites.
- not broken app/utils/config.py :dict grep-baseline flagged agent · deepseek-v4-flash-free silent
Settings.dict() on a plain non-pydantic class, plus the dict() builtin. Renaming either would be a bug.
4 matched lines · reasoning
7 def dict(self) -> dict: 9 return dict(self._values) 12 def load(**overrides) -> dict: 14 return settings.dict()
grep-baseline conf 0.50'BaseModel.dict' is named in the release notes and appears in 9 place(s) in this repo. No check was made that these are real call sites.
- breaks app/schemas/user.py :dict grep-baseline flagged agent · deepseek-v4-flash-free flagged
user.dict() on a real pydantic BaseModel instance.
3 matched lines · reasoning
16 def serialize(user: User) -> dict: 17 # BaseModel.dict() was renamed to model_dump() in v2. 18 return user.dict()
grep-baseline conf 0.50'BaseModel.dict' is named in the release notes and appears in 9 place(s) in this repo. No check was made that these are real call sites.
- breaks app/schemas/user.py :validator grep-baseline flagged agent · deepseek-v4-flash-free flagged
@validator decorator, imported from pydantic.
3 matched lines · reasoning
1 from pydantic import BaseModel, validator 8 # @validator was replaced by @field_validator in Pydantic v2. 9 @validator("email")grep-baseline conf 0.50'validator' is named in the release notes and appears in 3 place(s) in this repo. No check was made that these are real call sites.