I have a @root_validator without having any parameter in my project like this:
from pydantic import BaseModel, root_validator
class Model(BaseModel):
name: str
@root_validator
def validate_root(cls, values):
return values
In this way, bump-pydantic can't detect it and will not update it to a new version and without any TODO or anything.
Also, if I define my root_validator like @root_validator(), it will be detected and converted to @model_validator() without defining mode parameter.
The only successful convert will happen if I have @root_validator(pre=True). I've not checked other scenarios.
If it is an accepted bug, I will be happy to work on it and make a PR
Description
I have a @root_validator without having any parameter in my project like this:
In this way,
bump-pydantic
can't detect it and will not update it to a new version and without any TODO or anything. Also, if I define my root_validator like@root_validator()
, it will be detected and converted to@model_validator()
without definingmode
parameter. The only successful convert will happen if I have@root_validator(pre=True)
. I've not checked other scenarios.If it is an accepted bug, I will be happy to work on it and make a PR
My Environment
Python 3.11.4 bump-pydantic==0.7.0