This repository was archived by the owner on Sep 3, 2025. It is now read-only.
fix(pydantic): fixes several issues detected by pydantic v2#5966
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the codebase to support pydantic v2 by using the new ConfigDict and model_validate features while also updating imports accordingly.
- Added model_config with ConfigDict in ProjectRead to enable attribute-based initialization.
- Updated pydantic ValidationError import in document/service.py.
- Converted SQLAlchemy Project instances to Pydantic ProjectRead in individual/service.py and updated subsequent usage.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/dispatch/project/models.py | Updated ProjectRead with a new model_config for pydantic v2 support. |
| src/dispatch/individual/service.py | Replaced project usage with a validated ProjectRead instance via model_validate and updated corresponding create/update calls. |
| src/dispatch/document/service.py | Updated the import for ValidationError to align with pydantic v2 standards. |
ghost
approved these changes
May 8, 2025
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.