Skip to content

Fix Pydantic V3 deprecation warnings #728

@abrookins

Description

@abrookins

Problem

The codebase uses several Pydantic APIs that are deprecated in V2 and will be removed in V3:

  • parse_raw() method (line ~1979) - should use model_validate_json()
  • __fields__ attribute (lines ~1532, 1551, 2150) - should use model_fields class property
  • Instance-level model_fields access (line ~1465) - should access from class, not instance

Impact

These deprecation warnings are confusing for users and the code will break when Pydantic V3 is released.

Related

Solution

Replace deprecated APIs with their V2/V3-compatible equivalents:

  • cls.parse_raw()cls.model_validate_json()
  • cls.__fields__cls.model_fields
  • self.model_fieldsself.__class__.model_fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions