ExpectationConfiguration
- class great_expectations.core.ExpectationConfiguration(expectation_type: str, kwargs: dict, meta: Optional[dict] = None, success_on_last_run: Optional[bool] = None, ge_cloud_id: Optional[str] = None, expectation_context: Optional[great_expectations.core.expectation_configuration.ExpectationContext] = None, rendered_content: Optional[List[great_expectations.render.components.RenderedAtomicContent]] = None)#
-
Denies the parameters and name of a specific expectation.
- Parameters
-
-
expectation_type – The name of the expectation class to use in snake case, e.g. expect_column_values_to_not_be_null.
-
kwargs – The keyword arguments to pass to the expectation class.
-
meta – A dictionary of metadata to attach to the expectation.
-
success_on_last_run – Whether the expectation succeeded on the last run.
-
ge_cloud_id –
The corresponding GX Cloud ID for the expectation.
New in version 0.13.36: Used in GX Cloud deployments.
-
expectation_context –
The context for the expectation.
New in version 0.13.44: Used to support column descriptions in GX Cloud.
-
rendered_content –
Rendered content for the expectation.
New in version 0.15.14: Used to include rendered content dictionary in expectation configuration.
-
- Raises
-
-
InvalidExpectationConfigurationError – If expectation_type arg is not a str.
-
InvalidExpectationConfigurationError – If kwargs arg is not a dict.
-
InvalidExpectationKwargsError – If domain kwargs are missing.
-
ValueError – If a domain_type cannot be determined.
-
- get_success_kwargs() dict #
-
Gets the success and domain kwargs for this ExpectationConfiguration.
- Raises
-
ExpectationNotFoundError – If the expectation implementation is not found.
- Returns
-
A dictionary with the success and domain kwargs of an expectation.
- to_json_dict() Dict[str, Optional[Union[Dict[str, JSONValues], List[JSONValues], str, int, float, bool]]] #
-
Returns a JSON-serializable dict representation of this ExpectationConfiguration.
- Returns
-
A JSON-serializable dict representation of this ExpectationConfiguration.
- validate(validator: Validator, runtime_configuration: Optional[dict] = None) ExpectationValidationResult #
-
Runs the expectation against a Validator.
- Parameters
-
-
validator – Object responsible for running an Expectation against data.
-
runtime_configuration – A dictionary of configuration arguments to be used by the expectation.
-
- Raises
-
ExpectationNotFoundError – If the expectation implementation is not found.
- Returns
-
The validation result generated by running the expectation against the data.
- Return type