Skip to content

Commit

Permalink
Merge pull request #170 from 15r10nk/fix_pydantic_warning_169
Browse files Browse the repository at this point in the history
fix: fix a deprecation warning for the upcomming pydantic v2.11 (#169)
  • Loading branch information
15r10nk authored Jan 2, 2025
2 parents 8031edd + 6acdace commit 64b4b78
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed
- A bullet item for the Removed category.
-->
<!--
### Added
- A bullet item for the Added category.
-->
<!--
### Changed
- A bullet item for the Changed category.
-->
<!--
### Deprecated
- A bullet item for the Deprecated category.
-->
### Fixed

- use '.model_fields' on pydantic model class and not instance. This fixes a deprecation warning in the upcomming pydantic v2.11 (#169)

<!--
### Security
- A bullet item for the Security category.
-->
2 changes: 1 addition & 1 deletion src/inline_snapshot/_adapter/generic_call_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def get_fields(value):
from pydantic_core import PydanticUndefined

def get_fields(value):
return value.model_fields
return type(value).model_fields

from pydantic import BaseModel

Expand Down

0 comments on commit 64b4b78

Please sign in to comment.