RegexBasedColumnMapExpectation
- class great_expectations.expectations.regex_based_column_map_expectation.RegexBasedColumnMapExpectation(configuration: Optional[great_expectations.core.expectation_configuration.ExpectationConfiguration] = None)#
Base class for RegexBasedColumnMapExpectations.
RegexBasedColumnMapExpectations facilitate regex parsing as the core logic for a Map Expectation.
Example Definition:
ExpectColumnValuesToOnlyContainVowels(SetBasedColumnMapExpectation):
regex_camel_name = 'Vowel'
regex = '^[aeiouyAEIOUY]*$'
semantic_type_name_plural = 'vowels'
map_metric = RegexBasedColumnMapExpectation.register_metric(
regex_camel_name=regex_camel_name,
regex=regex
)- Parameters:
regex_camel_name (str) – A name describing a regex pattern, in camel case.
regex (str) – A valid regex pattern.
semantic_type_name_plural (optional[str]) – The plural form of a semantic type being validated by a regex pattern.
map_metric (str) – The name of an ephemeral metric, as returned by register_metric(…).
- domain_type = 'column'#
- validate_configuration(configuration: Optional[great_expectations.core.expectation_configuration.ExpectationConfiguration] = None) None #
Raise an exception if the configuration is not viable for an expectation.
- Parameters:
configuration – An ExpectationConfiguration
- Raises:
InvalidExpectationConfigurationError – If no regex or column specified, or if mostly parameter incorrectly defined.