-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The pydantic usage here is pretty light, so the changes needed aren't that dramatic. * The dataclass `__post_init_post_parse__` method is no longer supported and simply `__post_init__` should be used. * `TypeError` is no longer converted to `ValidationError` in validators, so just use `ValueError`. * The `@validator` decorator has changed to `@field_decorator` with a minor change in parameters. * Validator error messages now include the error type, which means `Value error` for all of our validators. * The `ValidationError.errors()` detail list now has a custom `ErrorDetail` type. This exposes the fact that the `loc` attribute is actually a tuple of `str` and `int`. Mypy flags that as an issue if an `int` is passed to `str.join`. We don't actually have any cases where an `int` would occur, but copy a converter from the documentation so it's handled correctly in case that does happen. This also allows dropping the mypy upper version pin as updated Pydantic contains the necessary compatibility fix. https://docs.pydantic.dev/2.7/migration/
- Loading branch information
1 parent
2b447e7
commit 5879080
Showing
6 changed files
with
188 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.