extract.validation
PydanticValidator Objects
class PydanticValidator(ValidateItem, Generic[_TPydanticModel])
__call__
def __call__(
item: TDataItems,
meta: Any = None) -> Union[_TPydanticModel, List[_TPydanticModel]]
Validate a data item against the pydantic model
create_item_validator
def create_item_validator(
columns: TTableHintTemplate[TAnySchemaColumns],
schema_contract: TTableHintTemplate[TSchemaContract] = None
) -> Tuple[Optional[ValidateItem], TTableHintTemplate[TSchemaContract]]
Creates item validator for a columns
definition and a schema_contract
Returns a tuple (validator, schema contract). If validator could not be created, returns None at first position. If schema_contract was not specified a default schema contract for given validator will be returned