Skip to main content

error_from_attributes

Emits an error when the model does not have from_attributes=True.

def error_from_attributes(
model_name: str,
api: CheckerPluginInterface,
context: Context
) - > None

Emits an error when the model does not have from_attributes=True.

Parameters

NameTypeDescription
model_namestrThe name of the Pydantic model being validated.
apiCheckerPluginInterfaceThe plugin interface used to emit the validation error message.
contextContextThe linting context providing location information for the error report.

Returns

TypeDescription
NoneNothing is returned; the function performs a side effect by reporting a failure to the plugin interface.