whylogs.core.validators
#
Submodules#
Package Contents#
Classes#
A validator that checks if a column satisfies a condition. |
|
Helper class that provides a standard way to create an ABC using |
- class whylogs.core.validators.ConditionValidator#
Bases:
whylogs.core.validators.validator.Validator
A validator that checks if a column satisfies a condition.
- Parameters
name (str) – The name of the ConditionValidator.
conditions (Dict[str, Union[Condition, Callable[[Any], bool]]]) – A dictionary of conditions to check.
actions (List[Union[Callable[[str, str, Any], None], Callable[[str, str, Any, Optional[Any]], None]]]) – A list of actions to take when a condition fails. The action arguments represent, respectively: condition validator name, condition name, invalid value, row identity value (if any).
enable_sampling (bool) – Whether to enable sampling of failed values. Defaults to True.
- conditions: Dict[str, Union[whylogs.core.metrics.condition_count_metric.Condition, Callable[[Any], bool]]]#
- actions: List[Union[Callable[[str, str, Any], None], Callable[[str, str, Any, Optional[Any]], None]]]#
- columnar_validate(data: Any, identity_values: Optional[Any] = None) None #
- Parameters
data (Any) –
identity_values (Optional[Any]) –
- Return type
- get_samples() List[Any] #
Returns a list of samples of failed values. The number of samples is determined by the validator’s sampling size, defined through the MetricConfig. If identity_column is set, the samples will be the identity values of the failed values. Otherwise, the samples will contain the failed values themselves.
- Return type
List[Any]
- class whylogs.core.validators.Validator#
Bases:
abc.ABC
Helper class that provides a standard way to create an ABC using inheritance.
- conditions: Dict[str, Union[whylogs.core.metrics.condition_count_metric.Condition, Callable[[Any], bool]]]#
- actions: List[Union[Callable[[str, str, Any], None], Callable[[str, str, Any, Optional[Any]], None]]]#