Skip to content

underscore_attrs_are_private: Pydantic v2 behaviour change #26

Description

@jogomojo

If Pydantic v2+ is installed, the following warning is given when importing pynqmetadata:

UserWarning: Valid config keys have changed in V2:
* 'underscore_attrs_are_private' has been removed
  warnings.warn(message, UserWarning)

The offending line is here:

class Config:
underscore_attrs_are_private = True

The Pydantic v2 migration guide says:

"the Pydantic V2 behavior is now the same as if this was always set to True in Pydantic V1"

Which means this can be removed when using v2. Suggest adding if/else with version checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions