Expectation
- class great_expectations.expectations.expectation.Expectation(configuration: Optional[great_expectations.core.expectation_configuration.ExpectationConfiguration] = None)#
Base class for all Expectations.
- Expectation classes must have the following attributes set:
domain_keys: a tuple of the keys used to determine the domain of the expectation
success_keys: a tuple of the keys used to determine the success of the expectation.
In some cases, subclasses of Expectation (such as TableExpectation) can inherit these properties from their parent class.
They may optionally override runtime_keys and default_kwarg_values, and may optionally set an explicit value for expectation_type.
runtime_keys lists the keys that can be used to control output but will not affect the actual success value of the expectation (such as result_format).
default_kwarg_values is a dictionary that will be used to fill unspecified kwargs from the Expectation Configuration.
- Expectation classes must implement the following:
_validate
get_validation_dependencies
In some cases, subclasses of Expectation, such as ColumnMapExpectation will already have correct implementations that may simply be inherited.
- Additionally, they may provide implementations of:
validate_configuration, which should raise an error if the configuration will not be usable for the Expectation
Data Docs rendering methods decorated with the @renderer decorator. See the
- validate_configuration(configuration: Optional[great_expectations.core.expectation_configuration.ExpectationConfiguration] = None) None #
Validates the configuration for the Expectation.
For all expectations, the configuration’s expectation_type needs to match the type of the expectation being configured. This method is meant to be overridden by specific expectations to provide additional validation checks as required. Overriding methods should call super().validate_configuration(configuration).
- Raises:
InvalidExpectationConfigurationError – The configuration does not contain the values required by the Expectation.