Skip to content

Change model_validator(mode="after") to model_validator(mode="before") #501

@lord-haffi

Description

@lord-haffi

This is useful for projects using this library especially for Unittests if you are using model_construct a lot. This is actually due to a bug (or unintendend side effect), see here pydantic/pydantic#6978.

For instance, this helps to resolve issues in PR https://github.com/Hochfrequenz/powercloud2lynqtech/pull/1816.

Otherwise, you would have to use model_construct on every nested structure.

Metadata

Metadata

Assignees

Labels

Python Specific 🐍a problem that is specific to this python implementation and not the bo4e data modelValidationbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions