Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recent PRs have been failing due to an issue with the linting step in the CI - I think caused by the recent release of Pydantic 2.11.
Overview of issues and proposed fixes:
get_model_fields
in_compat.py
.I think it's fine to ignore this one?
model_fields
inSQLModelMetaclass
on the other hand, now can do without an ignore warningSQLModel.model_validate()
is supposed to overwriteBaseModel.model_validate()
but an error gets raised because of theupdate
input parameter, which is not present inBaseModel.model_validate()
. The proposed solution here is to work via**kwargs
, which I'm generally not a fan of, but the only other option I would see is adding yet another ignore, which feels wrong in this case.SQLModel.model_dump()
is supposed to overwriteBaseModel.model_dump()
but an error gets raised because ofcontext
andalias
having a wrong type, andfallback
not being present.fallback
was introduced in Pydantic v2.11. So instead of restricting Pydantic, I suggest to (again) work via**kwargs
.The linting test is failing for Python 3.8 in different ways than for all other Python versions, probably because Python 3.8 support was removed for Pydantic 2.11. Accordingly, I've updated the
test.yml
to skip the linting test for Python 3.8. This doesn't feel like a clean solution either, and I guess the other option is to (also) drop support for Python 3.8.