Skip to content

migrate Account to pydantic v2 model_config - #76

Open
xyf5432 wants to merge 1 commit into
ddCat-main:mainfrom
xyf5432:fix/pydantic-v2
Open

xyf5432 wants to merge 1 commit into
ddCat-main:mainfrom
xyf5432:fix/pydantic-v2

Conversation

@xyf5432

@xyf5432 xyf5432 commented Aug 27, 2026

Copy link
Copy Markdown

Fixes #75

Summary

Replaces the deprecated pydantic v1 nested class Config: in Account (api.py)
with the v2 model_config = ConfigDict(from_attributes=True) form.

Every import of api.py under the pinned pydantic==2.5.3 currently emits a
PydanticDeprecatedSince20 warning. This removes it.

Changes

  • api.py: class Config: from_attributes = Truemodel_config = ConfigDict(from_attributes=True); import line adds ConfigDict.

Testing

  • Verified with pydantic 2.5.3 (the project's pinned version): zero warnings on
    import (before: 1 DeprecationWarning).
  • from_attributes semantics preserved: Account.model_validate(<ORM object>)
    populates fields identically.

Co-Authored-By: Claude <noreply@anthropic.com>
@xyf5432 xyf5432 changed the title migrate Account to pydantic v2 model_config (fixes #75) migrate Account to pydantic v2 model_config Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning on import: class-based Config in Account (pydantic v2)

1 participant