great_expectations.expectations.core

Submodules

Package Contents

Classes

ExpectColumnDistinctValuesToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Expect the set of distinct column values to be contained by a given set.

ExpectColumnDistinctValuesToContainSet(configuration: Optional[ExpectationConfiguration] = None)

Expect the set of distinct column values to contain a given set.

ExpectColumnDistinctValuesToEqualSet(configuration: Optional[ExpectationConfiguration] = None)

Expect the set of distinct column values to equal a given set.

ExpectColumnKlDivergenceToBeLessThan(configuration: Optional[ExpectationConfiguration] = None)

Expect the Kulback-Leibler (KL) divergence (relative entropy) of the specified column with respect to the partition object to be lower than the provided threshold.

ExpectColumnMaxToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column maximum to be between a minimum value and a maximum value.

ExpectColumnMeanToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column mean to be between a minimum value and a maximum value (inclusive).

ExpectColumnMedianToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column median to be between a minimum value and a maximum value.

ExpectColumnMinToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column minimum to be between a minimum value and a maximum value.

ExpectColumnMostCommonValueToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Expect the most common value to be within the designated value set.

ExpectColumnPairCramersPhiValueToBeLessThan(configuration: Optional[ExpectationConfiguration] = None)

Base class for all Expectations.

ExpectColumnPairValuesAToBeGreaterThanB(configuration: Optional[ExpectationConfiguration] = None)

Expect the values in column A to be greater than column B.

ExpectColumnPairValuesToBeEqual(configuration: Optional[ExpectationConfiguration] = None)

Expect the values in column A to be the same as column B.

ExpectColumnPairValuesToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Expect the paired values from columns A and B to belong to a set of valid pairs.

ExpectColumnProportionOfUniqueValuesToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the proportion of unique values to be between a minimum value and a maximum value.

ExpectColumnQuantileValuesToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the specific provided column quantiles to be between a minimum value and a maximum value.

ExpectColumnStdevToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column standard deviation to be between a minimum value and a maximum value.

ExpectColumnSumToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column to sum to be between a minimum value and a maximum value.

ExpectColumnToExist(configuration: Optional[ExpectationConfiguration] = None)

Expect the specified column to exist.

ExpectColumnUniqueValueCountToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the number of unique values to be between a minimum value and a maximum value.

ExpectColumnValueLengthsToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings with length between a minimum value and a maximum value (inclusive).

ExpectColumnValueLengthsToEqual(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings with length equal to the provided value.

ExpectColumnValueZScoresToBeLessThan(configuration: Optional[ExpectationConfiguration] = None)

Expect the Z-scores of a column’s values to be less than a given threshold.

ExpectColumnValuesToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be between a minimum value and a maximum value (inclusive).

ExpectColumnValuesToBeDateutilParseable(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be parsable using dateutil.

ExpectColumnValuesToBeDecreasing(configuration: Optional[ExpectationConfiguration] = None)

Expect the column values to be decreasing.

ExpectColumnValuesToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Expect each column value to be in a given set.

ExpectColumnValuesToBeInTypeList(configuration: Optional[ExpectationConfiguration] = None)

Expect a column to contain values from a specified type list.

ExpectColumnValuesToBeIncreasing(configuration: Optional[ExpectationConfiguration] = None)

Expect the column values to be increasing.

ExpectColumnValuesToBeJsonParseable(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be data written in JavaScript Object Notation.

ExpectColumnValuesToBeNull(configuration: Optional[ExpectationConfiguration] = None)

Expect the column values to be null.

ExpectColumnValuesToBeOfType(configuration: Optional[ExpectationConfiguration] = None)

Expect a column to contain values of a specified data type.

ExpectColumnValuesToBeUnique(configuration: Optional[ExpectationConfiguration] = None)

Expect each column value to be unique.

ExpectColumnValuesToMatchJsonSchema(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be JSON objects matching a given JSON schema.

ExpectColumnValuesToMatchLikePattern(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that match a given like pattern expression.

ExpectColumnValuesToMatchLikePatternList(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that match any of a provided list of like pattern expressions.

ExpectColumnValuesToMatchRegex(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that match a given regular expression.

ExpectColumnValuesToMatchRegexList(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that can be matched to either any of or all of a list of regular expressions.

ExpectColumnValuesToMatchStrftimeFormat(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings representing a date or time with a given format.

ExpectColumnValuesToNotBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Expect column entries to not be in the set.

ExpectColumnValuesToNotBeNull(configuration: Optional[ExpectationConfiguration] = None)

Expect the column values to not be null.

ExpectColumnValuesToNotMatchLikePattern(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that do NOT match a given like pattern expression.

ExpectColumnValuesToNotMatchLikePatternList(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that do NOT match any of a provided list of like pattern expressions.

ExpectColumnValuesToNotMatchRegex(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that do NOT match a given regular expression.

ExpectColumnValuesToNotMatchRegexList(configuration: Optional[ExpectationConfiguration] = None)

Expect the column entries to be strings that do not match any of a list of regular expressions. Matches can be anywhere in the string.

ExpectCompoundColumnsToBeUnique(configuration: Optional[ExpectationConfiguration] = None)

Expect the compound columns to be unique.

ExpectMulticolumnSumToEqual(configuration: Optional[ExpectationConfiguration] = None)

Expect that the sum of row values in a specified column list is the same for each row, and equal to a specified sum total.

ExpectMulticolumnValuesToBeUnique(configuration: Optional[ExpectationConfiguration] = None)

Expect that the columns are unique together (e.g. a multi-column primary key)

ExpectSelectColumnValuesToBeUniqueWithinRecord(configuration: Optional[ExpectationConfiguration] = None)

Expect the values for each record to be unique across the columns listed.

ExpectTableColumnCountToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the number of columns to be between two values.

ExpectTableColumnCountToEqual(configuration: Optional[ExpectationConfiguration] = None)

Expect the number of columns to equal a value.

ExpectTableColumnsToMatchOrderedList(configuration: Optional[ExpectationConfiguration] = None)

Expect the columns to exactly match a specified list.

ExpectTableColumnsToMatchSet(configuration: Optional[ExpectationConfiguration] = None)

Expect the columns to match an unordered set.

ExpectTableRowCountToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Expect the number of rows to be between two values.

ExpectTableRowCountToEqual(configuration: Optional[ExpectationConfiguration] = None)

Expect the number of rows to equal a value.

ExpectTableRowCountToEqualOtherTable(configuration: Optional[ExpectationConfiguration] = None)

Expect the number of rows to equal the number in another table.

class great_expectations.expectations.core.ExpectColumnDistinctValuesToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the set of distinct column values to be contained by a given set.

expect_column_distinct_values_to_be_in_set is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

The success value for this expectation will match that of [expect_column_values_to_be_in_set](https://greatexpectations.io/expectations/expect_column_values_to_be_in_set).

For example:

# my_df.my_col = [1,2,2,3,3,3]
>>> my_df.expect_column_distinct_values_to_be_in_set(
        "my_col",
        [2, 3, 4]
    )
{
    "success": false
    "result": {
        "observed_value": [1,2,3],
        "details": {
            "value_counts": [
                {
                    "value": 1,
                    "count": 1
                },
                {
                    "value": 2,
                    "count": 1
                },
                {
                    "value": 3,
                    "count": 1
                }
            ]
        }
    }
}
Parameters
  • column (str) – The column name.

  • value_set (set-like) – A set of objects used for comparison.

Keyword Arguments

parse_strings_as_datetimes (boolean or None) – If True values provided in value_set will be parsed as datetimes before making comparisons.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['column.value_counts']
success_keys = ['value_set', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column', 'value_set']
classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
classmethod _descriptive_value_counts_bar_chart_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validating that user has inputted a value set and that configuration has been initialized

_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnDistinctValuesToContainSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the set of distinct column values to contain a given set.

expect_column_distinct_values_to_contain_set is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • value_set (set-like) – A set of objects used for comparison.

Keyword Arguments

parse_strings_as_datetimes (boolean or None) – If True values provided in value_set will be parsed as datetimes before making comparisons.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['column.value_counts']
success_keys = ['value_set', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column', 'value_set']
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validating that user has inputted a value set and that configuration has been initialized

classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnDistinctValuesToEqualSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the set of distinct column values to equal a given set.

expect_column_distinct_values_to_equal_set is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • value_set (set-like) – A set of objects used for comparison.

Keyword Arguments

parse_strings_as_datetimes (boolean or None) – If True values provided in value_set will be parsed as datetimes before making comparisons.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['column.value_counts']
success_keys = ['value_set', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column', 'value_set']
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validating that user has inputted a value set and that configuration has been initialized

classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnKlDivergenceToBeLessThan(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the Kulback-Leibler (KL) divergence (relative entropy) of the specified column with respect to the partition object to be lower than the provided threshold.

KL divergence compares two distributions. The higher the divergence value (relative entropy), the larger the difference between the two distributions. A relative entropy of zero indicates that the data are distributed identically, when binned according to the provided partition.

In many practical contexts, choosing a value between 0.5 and 1 will provide a useful test.

This expectation works on both categorical and continuous partitions. See notes below for details.

expect_column_kl_divergence_to_be_less_than is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
Keyword Arguments
  • internal_weight_holdout (float between 0 and 1 or None) – The amount of weight to split uniformly among zero-weighted partition bins. internal_weight_holdout provides a mechanisms to make the test less strict by assigning positive weights to values observed in the data for which the partition explicitly expected zero weight. With no internal_weight_holdout, any value observed in such a region will cause KL divergence to rise to +Infinity. Defaults to 0.

  • tail_weight_holdout (float between 0 and 1 or None) – The amount of weight to add to the tails of the histogram. Tail weight holdout is split evenly between (-Infinity, min(partition_object[‘bins’])) and (max(partition_object[‘bins’]), +Infinity). tail_weight_holdout provides a mechanism to make the test less strict by assigning positive weights to values observed in the data that are not present in the partition. With no tail_weight_holdout, any value observed outside the provided partition_object will cause KL divergence to rise to +Infinity. Defaults to 0.

  • bucketize_data (boolean) – If True, then continuous data will be bucketized before evaluation. Setting this parameter to false allows evaluation of KL divergence with a None partition object for profiling against discrete data.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • observed_value field in the result object is customized for this expectation to be a float representing the true KL divergence (relative entropy) or None if the value is calculated as infinity, -infinity, or NaN

  • details.observed_partition in the result object is customized for this expectation to be a dict representing the partition observed in the data

  • details.expected_partition in the result object is customized for this expectation to be a dict representing the partition against which the data were compared, after applying specified weight holdouts

If the partition_object is categorical, this expectation will expect the values in column to also be categorical.

  • If the column includes values that are not present in the partition, the tail_weight_holdout will be equally split among those values, providing a mechanism to weaken the strictness of the expectation (otherwise, relative entropy would immediately go to infinity).

  • If the partition includes values that are not present in the column, the test will simply include zero weight for that value.

If the partition_object is continuous, this expectation will discretize the values in the column according to the bins specified in the partition_object, and apply the test to the resulting distribution.

  • The internal_weight_holdout and tail_weight_holdout parameters provide a mechanism to weaken the expectation, since an expected weight of zero would drive relative entropy to be infinite if any data are observed in that interval.

  • If internal_weight_holdout is specified, that value will be distributed equally among any intervals with weight zero in the partition_object.

  • If tail_weight_holdout is specified, that value will be appended to the tails of the bins ((-Infinity, min(bins)) and (max(bins), Infinity).

If relative entropy/kl divergence goes to infinity for any of the reasons mentioned above, the observed value will be set to None. This is because inf, -inf, Nan, are not json serializable and cause some json parsers to crash when encountered. The python None token will be serialized to null in json.

library_metadata
success_keys = ['partition_object', 'threshold', 'tail_weight_holdout', 'internal_weight_holdout', 'bucketize_data']
default_kwarg_values
args_keys = ['column', 'partition_object', 'threshold']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

get_validation_dependencies(self, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None)

Returns the result format and metrics required to validate this Expectation using the provided result format.

_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
classmethod _get_kl_divergence_chart(cls, partition_object, header=None)
classmethod _atomic_kl_divergence_chart_template(cls, partition_object: dict)
classmethod _get_kl_divergence_partition_object_table(cls, partition_object, header=None)
classmethod _atomic_partition_object_table_template(cls, partition_object: dict)
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_summary(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _atomic_diagnostic_observed_value_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _atomic_diagnostic_observed_value(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_histogram_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnMaxToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the column maximum to be between a minimum value and a maximum value.

expect_column_max_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations)

Parameters
  • column (str) – The column name

  • min_value (comparable type or None) – The minimum number of unique values allowed.

  • max_value (comparable type or None) – The maximum number of unique values allowed.

  • strict_min (boolean) – If True, the minimal column minimum must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the maximal column minimum must be strictly smaller than max_value, default=False

Keyword Arguments
  • parse_strings_as_datetimes (Boolean or None) – If True, parse min_value, max_values, and all non-null column values to datetimes before making comparisons.

  • output_strftime_format (str or None) – A valid strfime format for datetime output. Only used if parse_strings_as_datetimes=True.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be a list representing the actual column max

library_metadata
metric_dependencies = ['column.max']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'parse_strings_as_datetimes', 'auto', 'profiler_config']
max_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']

A Column Map MetricProvider Decorator for the Maximum

validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_stats_table_max_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnMeanToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the column mean to be between a minimum value and a maximum value (inclusive).

expect_column_mean_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • min_value (float or None) – The minimum value for the column mean.

  • max_value (float or None) – The maximum value for the column mean.

  • strict_min (boolean) – If True, the column mean must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the column mean must be strictly smaller than max_value, default=False

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound.

  • If max_value is None, then min_value is treated as a lower bound.

  • observed_value field in the result object is customized for this expectation to be a float representing the true mean for the column

library_metadata
metric_dependencies = ['column.mean']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'auto', 'profiler_config']
mean_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']
kwargs_json_schema_base_properties
kwargs_json_schema
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_stats_table_mean_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnMedianToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the column median to be between a minimum value and a maximum value.

expect_column_median_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • min_value (int or None) – The minimum value for the column median.

  • max_value (int or None) – The maximum value for the column median.

  • strict_min (boolean) – If True, the column median must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the column median must be strictly smaller than max_value, default=False

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be a float representing the true median for the column

library_metadata
metric_dependencies = ['column.median']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'auto', 'profiler_config']
median_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnMinToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the column minimum to be between a minimum value and a maximum value.

expect_column_min_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name

  • min_value (comparable type or None) – The minimal column minimum allowed.

  • max_value (comparable type or None) – The maximal column minimum allowed.

  • strict_min (boolean) – If True, the minimal column minimum must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the maximal column minimum must be strictly smaller than max_value, default=False

Keyword Arguments
  • parse_strings_as_datetimes (Boolean or None) – If True, parse min_value, max_values, and all non-null column values to datetimes before making comparisons.

  • output_strftime_format (str or None) – A valid strfime format for datetime output. Only used if parse_strings_as_datetimes=True.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be a list representing the actual column min

library_metadata
metric_dependencies = ['column.min']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'parse_strings_as_datetimes', 'auto', 'profiler_config']
min_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_stats_table_min_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnMostCommonValueToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

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](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name

  • value_set (set-like) – A list of potential values to match

Keyword Arguments

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
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

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

library_metadata
metric_dependencies = ['column.most_common_value']
success_keys = ['value_set', 'ties_okay']
default_kwarg_values
args_keys = ['column', 'value_set']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validating that user has inputted a value set and that configuration has been initialized

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnPairCramersPhiValueToBeLessThan(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Base class for all Expectations.

Expectation classes must have the following attributes set:
  1. domain_keys: a tuple of the keys used to determine the domain of the expectation

  2. 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.

  1. 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).

  2. default_kwarg_values is a dictionary that will be used to fill unspecified kwargs from the Expectation Configuration.

Expectation classes must implement the following:
  1. _validate

  2. 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:
  1. validate_configuration, which should raise an error if the configuration will not be usable for the Expectation

  2. Data Docs rendering methods decorated with the @renderer decorator. See the

library_metadata
metric_dependencies
success_keys = ['column_A', 'column_B', 'threshold']
default_kwarg_values
args_keys = ['column_A', 'column_B']
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnPairValuesAToBeGreaterThanB(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnPairMapExpectation

Expect the values in column A to be greater than column B.

expect_column_pair_values_a_to_be_greater_than_b is a [Column Pair Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_pair_map_expectations).

Parameters
  • column_A (str) – The first column name

  • column_B (str) – The second column name

  • or_equal (boolean or None) – If True, then values can be equal, not strictly greater

Keyword Arguments
  • allow_cross_type_comparisons (boolean or None) – If True, allow comparisons between types (e.g. integer and string). Otherwise, attempting such comparisons will raise an exception.

  • ignore_row_if (str) – “both_values_are_missing”, “either_value_is_missing”, “neither

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_pair_values.a_greater_than_b
success_keys = ['column_A', 'column_B', 'ignore_row_if', 'parse_strings_as_datetimes', 'allow_cross_type_comparisons', 'or_equal', 'mostly']
default_kwarg_values
args_keys = ['column_A', 'column_B', 'or_equal']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnPairValuesToBeEqual(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnPairMapExpectation

Expect the values in column A to be the same as column B.

expect_column_pair_values_to_be_equal is a [Column Pair Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_pair_map_expectations).

Parameters
  • column_A (str) – The first column name

  • column_B (str) – The second column name

Keyword Arguments

ignore_row_if (str) – “both_values_are_missing”, “either_value_is_missing”, “neither”

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_pair_values.equal
success_keys = ['column_A', 'column_B', 'ignore_row_if', 'mostly']
default_kwarg_values
args_keys = ['column_A', 'column_B']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnPairValuesToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnPairMapExpectation

Expect the paired values from columns A and B to belong to a set of valid pairs.

expect_column_pair_values_to_be_in_set is a [Column Pair Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_pair_map_expectations).

For example:

>>> d = {'fruit': ['appple','apple','apple','banana','banana'],
        'color': ['red','green','yellow','yellow','red']}
>>> my_df = pd.DataFrame(data=d)
>>> my_df.expect_column_pair_values_to_be_in_set(
        'fruit',
        'color',
        [
            ('apple','red'),
            ('apple','green'),
            ('apple','yellow'),
            ('banana','yellow'),
        ]
)
{
    "success": false,
    "meta": {},
    "exception_info": {
        "raised_exception": false,
        "exception_traceback": null,
        "exception_message": null
    },
    "result": {
        "element_count": 5,
        "unexpected_count": 1,
        "unexpected_percent": 20.0,
        "partial_unexpected_list": [
            [
                "banana",
                "red"
            ]
        ],
        "missing_count": 0,
        "missing_percent": 0.0,
        "unexpected_percent_total": 20.0,
        "unexpected_percent_nonmissing": 20.0
    }
}
Parameters
  • column_A (str) – The first column name

  • column_B (str) – The second column name

  • value_pairs_set (list of tuples) – All the valid pairs to be matched

Keyword Arguments

ignore_row_if (str) – “both_values_are_missing”, “either_value_is_missing”, “neither”

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_pair_values.in_set
success_keys = ['value_pairs_set', 'ignore_row_if', 'mostly']
default_kwarg_values
args_keys = ['column_A', 'column_B', 'value_pairs_set']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
class great_expectations.expectations.core.ExpectColumnProportionOfUniqueValuesToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the proportion of unique values to be between a minimum value and a maximum value.

For example, in a column containing [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], there are 4 unique values and 10 total values for a proportion of 0.4.

expect_column_proportion_of_unique_values_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • min_value (float or None) – The minimum proportion of unique values. (Proportions are on the range 0 to 1)

  • max_value (float or None) – The maximum proportion of unique values. (Proportions are on the range 0 to 1)

  • strict_min (boolean) – If True, the minimum proportion of unique values must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the maximum proportion of unique values must be strictly smaller than max_value, default=False

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be a float representing the proportion of unique values in the column

See also

[expect_column_unique_value_count_to_be_between](https://greatexpectations.io/expectations/expect_column_unique_value_count_to_be_between)

library_metadata
metric_dependencies = ['column.unique_proportion']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'auto', 'profiler_config']
column_proportion_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']

A Column Aggregate MetricProvider Decorator for the Unique Proportion

validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_column_properties_table_distinct_percent_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnQuantileValuesToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the specific provided column quantiles to be between a minimum value and a maximum value.

expect_column_quantile_values_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

For example:

# my_df.my_col = [1,2,2,3,3,3,4]
>>> my_df.expect_column_quantile_values_to_be_between(
    "my_col",
    {
        "quantiles": [0., 0.333, 0.6667, 1.],
        "value_ranges": [[0,1], [2,3], [3,4], [4,5]]
    }
)
{
  "success": True,
    "result": {
      "observed_value": {
        "quantiles: [0., 0.333, 0.6667, 1.],
        "values": [1, 2, 3, 4],
      }
      "element_count": 7,
      "missing_count": 0,
      "missing_percent": 0.0,
      "details": {
        "success_details": [true, true, true, true]
      }
    }
  }
}

expect_column_quantile_values_to_be_between can be computationally intensive for large datasets.

Parameters
  • column (str) – The column name.

  • quantile_ranges (dictionary with keys 'quantiles' and 'value_ranges') – Key ‘quantiles’ is an increasingly ordered list of desired quantile values (floats). Key ‘value_ranges’ is a list of 2-value lists that specify a lower and upper bound (inclusive) for the corresponding quantile (with [min, max] ordering). The length of the ‘quantiles’ list and the ‘value_ranges’ list must be equal.

  • allow_relative_error (boolean or string) – Whether to allow relative error in quantile communications on backends that support or require it.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive.

  • If min_value is None, then max_value is treated as an upper bound only

  • If max_value is None, then min_value is treated as a lower bound only

  • details.success_details field in the result object is customized for this expectation

library_metadata
metric_dependencies = ['column.quantile_values']
success_keys = ['quantile_ranges', 'allow_relative_error', 'auto', 'profiler_config']
quantile_value_ranges_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'quantile_ranges', 'allow_relative_error']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_summary(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _atomic_diagnostic_observed_value_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _atomic_diagnostic_observed_value(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_quantile_table_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
get_validation_dependencies(self, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None)

Returns the result format and metrics required to validate this Expectation using the provided result format.

_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnStdevToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the column standard deviation to be between a minimum value and a maximum value.

Uses sample standard deviation (normalized by N-1).

expect_column_stdev_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • min_value (float or None) – The minimum value for the column standard deviation.

  • max_value (float or None) – The maximum value for the column standard deviation.

  • strict_min (boolean) – If True, the column standard deviation must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the column standard deviation must be strictly smaller than max_value, default=False

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be a float representing the true standard deviation for the column

library_metadata
metric_dependencies = ['column.standard_deviation']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'auto', 'profiler_config']
stdev_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnSumToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the column to sum to be between a minimum value and a maximum value.

expect_column_sum_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name

  • min_value (comparable type or None) – The minimal sum allowed.

  • max_value (comparable type or None) – The maximal sum allowed.

  • strict_min (boolean) – If True, the minimal sum must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, the maximal sum must be strictly smaller than max_value, default=False

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be a list representing the actual column sum

library_metadata
metric_dependencies = ['column.sum']
success_keys = ['min_value', 'strict_min', 'max_value', 'strict_max', 'auto', 'profiler_config']
column_sum_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']

A Column Map Metric Decorator for the Sum

validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnToExist(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the specified column to exist.

expect_column_to_exist is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Parameters

column (str) – The column name.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['table.columns']
success_keys = ['column', 'column_index']
domain_keys = ['batch_id', 'table']
default_kwarg_values
args_keys = ['column', 'column_index']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnUniqueValueCountToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnExpectation

Expect the number of unique values to be between a minimum value and a maximum value.

expect_column_unique_value_count_to_be_between is a [Column Aggregate Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_aggregate_expectations).

Parameters
  • column (str) – The column name.

  • min_value (int or None) – The minimum number of unique values allowed.

  • max_value (int or None) – The maximum number of unique values allowed.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive.

  • If min_value is None, then max_value is treated as an upper bound

  • If max_value is None, then min_value is treated as a lower bound

  • observed_value field in the result object is customized for this expectation to be an int representing the number of unique values the column

See also

[expect_column_proportion_of_unique_values_to_be_between](https://greatexpectations.io/expectations/expect_column_proportion_of_unique_values_to_be_between)

library_metadata
metric_dependencies = ['column.distinct_values.count']
success_keys = ['min_value', 'max_value', 'auto', 'profiler_config']
column_unique_values_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value']

A Column Aggregate Metric Decorator for the Unique Value Count

validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_column_properties_table_distinct_count_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnValueLengthsToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings with length between a minimum value and a maximum value (inclusive).

This expectation only works for string-type values. Invoking it on ints or floats will raise a TypeError.

expect_column_value_lengths_to_be_between is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • min_value (int or None) – The minimum value for a column entry length.

  • max_value (int or None) – The maximum value for a column entry length.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive.

  • If min_value is None, then max_value is treated as an upper bound, and the number of acceptable rows has no minimum.

  • If max_value is None, then min_value is treated as a lower bound, and the number of acceptable rows has no maximum.

library_metadata
map_metric = column_values.value_length.between
success_keys = ['min_value', 'max_value', 'strict_min', 'strict_max', 'mostly', 'auto', 'profiler_config']
column_min_length_range_estimator_parameter_builder_config
column_max_length_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValueLengthsToEqual(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings with length equal to the provided value.

This expectation only works for string-type values. Invoking it on ints or floats will raise a TypeError.

expect_column_values_to_be_between is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • value (int or None) – The expected value for a column entry length.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

See also

[expect_column_value_lengths_to_be_between](https://greatexpectations.io/expectations/expect_column_value_lengths_to_be_between)

library_metadata
map_metric = column_values.value_length.equals
success_keys = ['value', 'mostly', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column', 'value']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValueZScoresToBeLessThan(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the Z-scores of a column’s values to be less than a given threshold.

expect_column_values_to_be_of_type is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations) for typed-column backends, and also for PandasExecutionEngine where the column dtype and provided type_ are unambiguous constraints (any dtype except ‘object’ or dtype of ‘object’ with type_ specified as ‘object’).

Parameters
  • column (str) – The column name of a numerical column.

  • threshold (number) – A maximum Z-score threshold. All column Z-scores that are lower than this threshold will evaluate successfully.

Keyword Arguments
  • mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

  • double_sided (boolean) – A True or False value indicating whether to evaluate double sidedly. Examples… (double_sided = True, threshold = 2) -> Z scores in non-inclusive interval(-2,2) | (double_sided = False, threshold = 2) -> Z scores in non-inclusive interval (-infinity,2)

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.z_score.under_threshold
success_keys = ['threshold', 'double_sided', 'mostly']
default_kwarg_values
args_keys = ['column', 'threshold']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

class great_expectations.expectations.core.ExpectColumnValuesToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be between a minimum value and a maximum value (inclusive).

expect_column_values_to_be_between is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations)

Parameters
  • column (str) – The column name.

  • min_value (comparable type or None) – The minimum value for a column entry.

  • max_value (comparable type or None) – The maximum value for a column entry.

  • strict_min (boolean) – If True, values must be strictly larger than min_value, default=False

  • strict_max (boolean) – If True, values must be strictly smaller than max_value, default=False

Keyword Arguments
  • allow_cross_type_comparisons (boolean or None) – If True, allow comparisons between types (e.g. integer and string). Otherwise, attempting such comparisons will raise an exception.

  • parse_strings_as_datetimes (boolean or None) – If True, parse min_value, max_value, and all non-null column values to datetimes before making comparisons.

  • output_strftime_format (str or None) – A valid strfime format for datetime output. Only used if parse_strings_as_datetimes=True.

  • mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive unless strict_min or strict_max are set to True.

  • If min_value is None, then max_value is treated as an upper bound, and there is no minimum value checked.

  • If max_value is None, then min_value is treated as a lower bound, and there is no maximum value checked.

See also

[expect_column_value_lengths_to_be_between](https://greatexpectations.io/expectations/expect_column_value_lengths_to_be_between)

library_metadata
map_metric = column_values.between
success_keys = ['min_value', 'max_value', 'strict_min', 'strict_max', 'allow_cross_type_comparisons', 'mostly', 'parse_strings_as_datetimes', 'auto', 'profiler_config']
column_min_range_estimator_parameter_builder_config
column_max_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'min_value', 'max_value', 'strict_min', 'strict_max']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToBeDateutilParseable(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be parsable using dateutil.

expect_column_values_to_be_dateutil_parseable is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations)

Parameters

column (str) – The column name.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.dateutil_parseable
success_keys = ['mostly']
default_kwarg_values
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToBeDecreasing(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column values to be decreasing.

By default, this expectation only works for numeric or datetime data. When ‘parse_strings_as_datetimes=True’, it can also parse strings to datetimes.

If ‘strictly=True’, then this expectation is only satisfied if each consecutive value is strictly decreasing–equal values are treated as failures.

expect_column_values_to_be_decreasing is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations)

Parameters

column (str) – The column name.

Keyword Arguments
  • strictly (Boolean or None) – If True, values must be strictly greater than previous values

  • parse_strings_as_datetimes (boolean or None) – If True, all non-null column values to datetimes before making comparisons

  • mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.decreasing
success_keys = ['strictly', 'mostly', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect each column value to be in a given set.

For example:

# my_df.my_col = [1,2,2,3,3,3]
>>> my_df.expect_column_values_to_be_in_set(
        "my_col",
        [2,3]
    )
{
    "success": false
    "result": {
        "unexpected_count": 1
        "unexpected_percent": 16.66666666666666666,
        "unexpected_percent_nonmissing": 16.66666666666666666,
        "partial_unexpected_list": [
            1
        ],
    },
}

expect_column_values_to_be_in_set is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • value_set (set-like) – A set of objects used for comparison.

Keyword Arguments
Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.in_set
args_keys = ['column', 'value_set']
success_keys = ['value_set', 'mostly', 'parse_strings_as_datetimes', 'auto', 'profiler_config']
value_set_estimator_parameter_builder_config :ParameterBuilderConfig
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
classmethod _descriptive_example_values_block_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validates that a value_set has been provided.

class great_expectations.expectations.core.ExpectColumnValuesToBeInTypeList(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect a column to contain values from a specified type list.

expect_column_values_to_be_in_type_list is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations) for typed-column backends, and also for PandasDataset where the column dtype provides an unambiguous constraints (any dtype except ‘object’).

For PandasDataset columns with dtype of ‘object’ expect_column_values_to_be_in_type_list will independently check each row’s type.

Parameters
  • column (str) – The column name.

  • type_list (str) – A list of strings representing the data type that each column should have as entries. Valid types are defined by the current backend implementation and are dynamically loaded. For example, valid types for PandasDataset include any numpy dtype values (such as ‘int64’) or native python types (such as ‘int’), whereas valid types for a SqlAlchemyDataset include types named by the current driver such as ‘INTEGER’ in most SQL dialects and ‘TEXT’ in dialects such as postgresql. Valid types for SparkDFDataset include ‘StringType’, ‘BooleanType’ and other pyspark-defined type names.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.in_type_list
success_keys = ['type_list', 'mostly']
default_kwarg_values
args_keys = ['column', 'type_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate_pandas(self, actual_column_type, expected_types_list)
_validate_sqlalchemy(self, actual_column_type, expected_types_list, execution_engine)
_validate_spark(self, actual_column_type, expected_types_list)
get_validation_dependencies(self, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Returns the result format and metrics required to validate this Expectation using the provided result format.

_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnValuesToBeIncreasing(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column values to be increasing.

By default, this expectation only works for numeric or datetime data. When ‘parse_strings_as_datetimes=True’, it can also parse strings to datetimes.

If ‘strictly=True’, then this expectation is only satisfied if each consecutive value is strictly increasing–equal values are treated as failures.

expect_column_values_to_be_increasing is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters

column (str) – The column name.

Keyword Arguments
  • strictly (Boolean or None) – If True, values must be strictly greater than previous values

  • parse_strings_as_datetimes (boolean or None) – If True, all non-null column values to datetimes before making comparisons

  • mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.increasing
success_keys = ['strictly', 'mostly', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToBeJsonParseable(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be data written in JavaScript Object Notation.

expect_column_values_to_be_json_parseable is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters

column (str) – The column name.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

See also

[expect_column_values_to_match_json_schema](https://greatexpectations.io/expectations/expect_column_values_to_match_json_schema)

library_metadata
map_metric = column_values.json_parseable
success_keys = ['mostly']
default_kwarg_values
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToBeNull(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column values to be null.

expect_column_values_to_be_null is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters

column (str) – The column name.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.null
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
get_validation_dependencies(self, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Returns the result format and metrics required to validate this Expectation using the provided result format.

_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnValuesToBeOfType(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect a column to contain values of a specified data type.

expect_column_values_to_be_of_type is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations) for typed-column backends, and also for PandasDataset where the column dtype and provided type_ are unambiguous constraints (any dtype except ‘object’ or dtype of ‘object’ with type_ specified as ‘object’).

For PandasDataset columns with dtype of ‘object’ expect_column_values_to_be_of_type will independently check each row’s type.

Parameters
  • column (str) – The column name.

  • type\_ (str) – A string representing the data type that each column should have as entries. Valid types are defined by the current backend implementation and are dynamically loaded. For example, valid types for PandasDataset include any numpy dtype values (such as ‘int64’) or native python types (such as ‘int’), whereas valid types for a SqlAlchemyDataset include types named by the current driver such as ‘INTEGER’ in most SQL dialects and ‘TEXT’ in dialects such as postgresql. Valid types for SparkDFDataset include ‘StringType’, ‘BooleanType’ and other pyspark-defined type names.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

See also

[expect_column_values_to_be_in_type_list](https://greatexpectations.io/expectations/expect_column_values_to_be_in_type_list)

library_metadata
map_metric = column_values.of_type
success_keys = ['type_', 'mostly']
default_kwarg_values
args_keys = ['column', 'type_']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate_pandas(self, actual_column_type, expected_type)
_validate_sqlalchemy(self, actual_column_type, expected_type, execution_engine)
_validate_spark(self, actual_column_type, expected_type)
get_validation_dependencies(self, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Returns the result format and metrics required to validate this Expectation using the provided result format.

_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnValuesToBeUnique(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect each column value to be unique.

This expectation detects duplicates. All duplicated values are counted as exceptions.

For example, [1, 2, 3, 3, 3] will return [3, 3, 3] in result.exceptions_list, with unexpected_percent = 60.0.

expect_column_values_to_be_unique is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations)

Parameters

column (str) – The column name.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.unique
success_keys = ['mostly']
default_kwarg_values
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToMatchJsonSchema(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be JSON objects matching a given JSON schema.

expect_column_values_to_match_json_schema is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • json_schema (str) – The JSON schema (in string form) to match

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

See also

[expect_column_values_to_be_json_parseable](https://greatexpectations.io/expectations/expect_column_values_to_be_json_parseable) [The JSON-schema docs](https://json-schema.org)

library_metadata
map_metric = column_values.match_json_schema
success_keys = ['json_schema', 'mostly']
default_kwarg_values
args_keys = ['column', 'json_schema']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToMatchLikePattern(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that match a given like pattern expression.

expect_column_values_to_match_like_pattern is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • like_pattern (str) – The like pattern expression the column entries should match.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.match_like_pattern
success_keys = ['mostly', 'like_pattern']
default_kwarg_values
args_keys = ['column', 'like_pattern']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToMatchLikePatternList(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that match any of a provided list of like pattern expressions.

expect_column_values_to_match_like_pattern_list is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • like_pattern_list (List[str]) – The list of like pattern expressions the column entries should match.

Keyword Arguments
Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.match_like_pattern_list
success_keys = ['mostly', 'like_pattern_list', 'match_on']
default_kwarg_values
args_keys = ['column', 'like_pattern_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToMatchRegex(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that match a given regular expression.

Valid matches can be found anywhere in the string, for example “[at]+” will identify the following strings as expected: “cat”, “hat”, “aa”, “a”, and “t”, and the following strings as unexpected: “fish”, “dog”.

expect_column_values_to_match_regex is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • regex (str) – The regular expression the column entries should match.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.match_regex
success_keys = ['regex', 'mostly', 'auto', 'profiler_config']
regex_pattern_string_parameter_builder_config :ParameterBuilderConfig
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'regex']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _question_renderer(cls, configuration, result=None, runtime_configuration=None)
classmethod _answer_renderer(cls, configuration=None, result=None, runtime_configuration=None)
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToMatchRegexList(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that can be matched to either any of or all of a list of regular expressions.

Matches can be anywhere in the string.

expect_column_values_to_match_regex_list is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • regex_list (list) – The list of regular expressions which the column entries should match

Keyword Arguments
  • match_on (string) – “any” or “all”. Use “any” if the value should match at least one regular expression in the list. Use “all” if it should match each regular expression in the list.

  • mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.match_regex_list
success_keys = ['regex_list', 'match_on', 'mostly']
default_kwarg_values
args_keys = ['column', 'regex_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToMatchStrftimeFormat(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings representing a date or time with a given format.

expect_column_values_to_match_strftime_format is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • strftime_format (str) – A strftime format string to use for matching

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.match_strftime_format
success_keys = ['strftime_format', 'mostly', 'auto', 'profiler_config']
date_format_string_parameter_builder_config :ParameterBuilderConfig
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'strftime_format']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToNotBeInSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect column entries to not be in the set.

For example:

# my_df.my_col = [1,2,2,3,3,3]
>>> my_df.expect_column_values_to_not_be_in_set(
        "my_col",
        [1,2]
    )
{
    "success": false
    "result": {
        "unexpected_count": 3
        "unexpected_percent": 50.0,
        "unexpected_percent_nonmissing": 50.0,
        "partial_unexpected_list": [
            1, 2, 2
        ],
    },
}

expect_column_values_to_not_be_in_set is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • value_set (set-like) – A set of objects used for comparison.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.not_in_set
success_keys = ['value_set', 'mostly', 'parse_strings_as_datetimes']
default_kwarg_values
args_keys = ['column', 'value_set']
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validates that a value_set has been provided.

classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
_pandas_column_values_not_in_set(self, series: pd.Series, metrics: Dict, metric_domain_kwargs: dict, metric_value_kwargs: dict, runtime_configuration: Optional[dict] = None, filter_column_isnull: bool = True)
class great_expectations.expectations.core.ExpectColumnValuesToNotBeNull(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column values to not be null.

To be counted as an exception, values must be explicitly null or missing, such as a NULL in PostgreSQL or an np.NaN in pandas. Empty strings don’t count as null unless they have been coerced to a null type.

expect_column_values_to_not_be_null is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters

column (str) – The column name.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.nonnull
args_keys = ['column']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_column_properties_table_missing_count_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_column_properties_table_missing_percent_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectColumnValuesToNotMatchLikePattern(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that do NOT match a given like pattern expression.

expect_column_values_to_not_match_like_pattern is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • like_pattern (str) – The like pattern expression the column entries should NOT match.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.not_match_like_pattern
success_keys = ['mostly', 'like_pattern']
default_kwarg_values
args_keys = ['column', 'like_pattern']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToNotMatchLikePatternList(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that do NOT match any of a provided list of like pattern expressions.

expect_column_values_to_not_match_like_pattern_list is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • like_pattern_list (List[str]) – The list of like pattern expressions the column entries should NOT match.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.not_match_like_pattern_list
success_keys = ['like_pattern_list', 'mostly']
default_kwarg_values
args_keys = ['column', 'like_pattern_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToNotMatchRegex(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that do NOT match a given regular expression.

The regex must not match any portion of the provided string. For example, “[at]+” would identify the following strings as expected: “fish”, “dog”, and the following as unexpected: “cat”, “hat”.

expect_column_values_to_not_match_regex is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • regex (str) – The regular expression the column entries should NOT match.

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.not_match_regex
success_keys = ['regex', 'mostly', 'auto', 'profiler_config']
regex_pattern_string_parameter_builder_config :ParameterBuilderConfig
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column', 'regex']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _descriptive_column_properties_table_regex_count_row_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectColumnValuesToNotMatchRegexList(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect the column entries to be strings that do not match any of a list of regular expressions. Matches can be anywhere in the string.

expect_column_values_to_not_match_regex_list is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

Parameters
  • column (str) – The column name.

  • regex_list (list) – The list of regular expressions which the column entries should not match

Keyword Arguments

mostly (None or a float between 0 and 1) – Successful if at least mostly fraction of values match the expectation. For more detail, see [mostly](https://docs.greatexpectations.io/docs/reference/expectations/standard_arguments/#mostly).

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = column_values.not_match_regex_list
success_keys = ['regex_list', 'mostly']
default_kwarg_values
args_keys = ['column', 'regex_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectCompoundColumnsToBeUnique(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.MulticolumnMapExpectation

Expect the compound columns to be unique.

expect_compound_columns_to_be_unique is a [Multicolumn Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_multicolumn_map_expectations).

Parameters

column_list (tuple or list) – Set of columns to be checked

Keyword Arguments

ignore_row_if (str) – “all_values_are_missing”, “any_value_is_missing”, “never”

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = compound_columns.unique
default_kwarg_values
args_keys = ['column_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectMulticolumnSumToEqual(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.MulticolumnMapExpectation

Expect that the sum of row values in a specified column list is the same for each row, and equal to a specified sum total.

expect_multicolumn_sum_to_equal is a [Multicolumn Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_multicolumn_map_expectations).

Parameters
  • column_list (tuple or list) – Set of columns to be checked

  • sum_total (int) – expected sum of columns

Keyword Arguments

ignore_row_if (str) – “all_values_are_missing”, “any_value_is_missing”, “never”

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = multicolumn_sum.equal
success_keys = ['mostly', 'sum_total']
default_kwarg_values
args_keys = ['column_list', 'sum_total']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectMulticolumnValuesToBeUnique(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.ColumnMapExpectation

Expect that the columns are unique together (e.g. a multi-column primary key)

Note that all instances of any duplicates are considered failed

expect_multicolumnvalues_to_be_unique is a [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations).

For example:

A B C
1 1 2 Fail
1 2 3 Pass
1 1 2 Fail
2 2 2 Pass
3 2 3 Pass
Args:

column_list (tuple or list): The column names to evaluate

Keyword Args:

ignore_row_if (str): “all_values_are_missing”, “any_value_is_missing”, “never”

Other Parameters
Returns:

An [ExpectationSuiteValidationResult](https://docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

library_metadata
metric_dependencies
success_keys = ['column_list', 'ignore_row_if', 'mostly']
default_kwarg_values
args_keys = ['column_list']
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectSelectColumnValuesToBeUniqueWithinRecord(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.MulticolumnMapExpectation

Expect the values for each record to be unique across the columns listed.

Note that records can be duplicated.

expect_select_column_values_to_be_unique_within_record is a [Multicolumn Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_multicolumn_map_expectations).

For example:

A B C
1 1 2 Fail
1 2 3 Pass
8 2 7 Pass
1 2 3 Pass
4 4 4 Fail
Parameters

column_list (tuple or list) – The column names to evaluate

Keyword Arguments

ignore_row_if (str) – “all_values_are_missing”, “any_value_is_missing”, “never”

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
map_metric = select_column_values.unique.within_record
default_kwarg_values
args_keys = ['column_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
class great_expectations.expectations.core.ExpectTableColumnCountToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the number of columns to be between two values.

expect_table_column_count_to_be_between is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Keyword Arguments
  • min_value (int or None) – The minimum number of columns, inclusive.

  • max_value (int or None) – The maximum number of columns, inclusive.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive.

  • If min_value is None, then max_value is treated as an upper bound, and the number of acceptable columns has no minimum.

  • If max_value is None, then min_value is treated as a lower bound, and the number of acceptable columns has no maximum.

library_metadata
metric_dependencies = ['table.column_count']
success_keys = ['min_value', 'max_value']
default_kwarg_values
args_keys = ['min_value', 'max_value']

A Metric Decorator for the Column Count

validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectTableColumnCountToEqual(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the number of columns to equal a value.

expect_table_column_count_to_equal is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Parameters

value (int) – The expected number of columns.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

See also

[expect_table_column_count_to_be_between](https://greatexpectations.io/expectations/expect_table_column_count_to_be_between)

library_metadata
metric_dependencies = ['table.column_count']
success_keys = ['value']
default_kwarg_values
args_keys = ['value']

A Metric Decorator for the Column Count

validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectTableColumnsToMatchOrderedList(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the columns to exactly match a specified list.

expect_table_columns_to_match_ordered_list is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Parameters

column_list (list of str) – The column names, in the correct order.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['table.columns']
success_keys = ['column_list']
domain_keys = ['batch_id', 'table', 'row_condition', 'condition_parser']
default_kwarg_values
args_keys = ['column_list']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectTableColumnsToMatchSet(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the columns to match an unordered set.

expect_table_columns_to_match_set is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Parameters
  • column_set (list of str) – The column names, in any order.

  • exact_match (boolean) – Whether the list of columns must exactly match the observed columns.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['table.columns']
success_keys = ['column_set', 'exact_match', 'auto', 'profiler_config']
mean_table_columns_set_match_multi_batch_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['column_set', 'exact_match']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectTableRowCountToBeBetween(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the number of rows to be between two values.

expect_table_row_count_to_be_between is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Keyword Arguments
  • min_value (int or None) – The minimum number of rows, inclusive.

  • max_value (int or None) – The maximum number of rows, inclusive.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

Notes

  • min_value and max_value are both inclusive.

  • If min_value is None, then max_value is treated as an upper bound, and the number of acceptable rows has no minimum.

  • If max_value is None, then min_value is treated as a lower bound, and the number of acceptable rows has no maximum.

library_metadata
metric_dependencies = ['table.row_count']
success_keys = ['min_value', 'max_value', 'auto', 'profiler_config']
table_row_count_range_estimator_parameter_builder_config
validation_parameter_builder_configs :List[ParameterBuilderConfig]
default_profiler_config
default_kwarg_values
args_keys = ['min_value', 'max_value']
validate_configuration(self, configuration: Optional[ExpectationConfiguration])

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectTableRowCountToEqual(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the number of rows to equal a value.

expect_table_row_count_to_equal is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Parameters

value (int) – The expected number of rows.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['table.row_count']
success_keys = ['value']
default_kwarg_values
args_keys = ['value']
validate_configuration(self, configuration: Optional[ExpectationConfiguration] = None)

Validates that a configuration has been set, and sets a configuration if it has yet to be set. Ensures that necessary configuration arguments have been provided for the validation of the expectation.

Parameters

configuration (OPTIONAL[ExpectationConfiguration]) – An optional Expectation Configuration entry that will be used to configure the expectation

Returns

None. Raises InvalidExpectationConfigurationError if the config is not validated successfully

classmethod _prescriptive_template(cls, renderer_configuration: RendererConfiguration)
classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None)
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)
class great_expectations.expectations.core.ExpectTableRowCountToEqualOtherTable(configuration: Optional[ExpectationConfiguration] = None)

Bases: great_expectations.expectations.expectation.TableExpectation

Expect the number of rows to equal the number in another table.

expect_table_row_count_to_equal_other_table is a [Table Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_table_expectations).

Parameters

other_table_name (str) – The name of the other table.

Other Parameters
Returns

//docs.greatexpectations.io/docs/terms/validation_result)

Exact fields vary depending on the values passed to result_format, include_config, catch_exceptions, and meta.

Return type

An [ExpectationSuiteValidationResult](https

library_metadata
metric_dependencies = ['table.row_count']
success_keys = ['other_table_name']
default_kwarg_values
args_keys = ['other_table_name']
classmethod _atomic_prescriptive_template(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)

Template function that contains the logic that is shared by AtomicPrescriptiveRendererType.SUMMARY and LegacyRendererType.PRESCRIPTIVE.

classmethod _prescriptive_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
classmethod _diagnostic_observed_value_renderer(cls, configuration: Optional[ExpectationConfiguration] = None, result: Optional[ExpectationValidationResult] = None, runtime_configuration: Optional[dict] = None, **kwargs)
get_validation_dependencies(self, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None)

Returns the result format and metrics required to validate this Expectation using the provided result format.

validate_configuration(self, configuration: Optional[ExpectationConfiguration])
_validate(self, configuration: ExpectationConfiguration, metrics: Dict, runtime_configuration: Optional[dict] = None, execution_engine: Optional[ExecutionEngine] = None)