Pydantic dataclass
Reports incorrect or unsafe configuration of pydantic dataclasses and models that are discovered via the PEP 681 dataclass_transform mechanism.
The inspection currently checks for:
Invalid validation configuration: both
validate_by_aliasandvalidate_by_nameare set toFalse(for example viamodel_configor__pydantic_config__), which disables all field matching during validation.Mutating frozen Pydantic fields: assignments to or deletions of attributes declared with
Field(frozen=True)in Pydantic models and dataclasses.
Invalid validation configuration
Mutating a frozen field
You can disable this inspection or change its severity in the Settings | Editor | Inspections dialog.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
PydanticDataclass- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: PydanticDataclassInspection
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: | IntelliJ IDEA 2026.3, PyCharm 2026.3, Qodana for JVM 2026.3, |