Expect the most common value to be within the designated value set.
expect_column_most_common_value_to_be_in_set
This expectation level is PRODUCTION
Contributors:
Tags:
core expectation
column aggregate expectation
Metrics:
column.most_common_value
Description
Expect the most common value to be within the designated value set.
expect_column_most_common_value_to_be_in_set is a Column Aggregate Expectation.
Args:
- column (str): The column name
- value_set (set-like): A list of potential values to match
Keyword Args:
- ties_okay (boolean or None): If True, then the expectation will still succeed if values outside the designated set are as common (but not more common) than designated values
Other Parameters:
- result_format (str or None): Which output mode to use: BOOLEAN_ONLY, BASIC, COMPLETE, or SUMMARY. For more detail, see result_format.
- include_config (boolean): If True, then include the expectation config as part of the result object.
- catch_exceptions (boolean or None): If True, then catch exceptions and include them as part of the result object. For more detail, see catch_exceptions.
- meta (dict or None): A JSON-serializable dictionary (nesting allowed) that will be included in the output without modification. For more detail, see meta.
Returns:
Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.
Notes:
- observed_value field in the result object is customized for this expectation to be a list representing the most common values in the column, which is often a single element... if there is a tie for most common among multiple values, observed_value will contain a single copy of each most common value
Want to make your own Expectation or an improvement to this one?
We've put together some great how to guides (including videos) on how to create your own expectations in a flash!
You can see those resources here: Contributor Resources