Skip to main content
Version: 0.18.9

column_aggregate_metric_provider.py

class great_expectations.expectations.metrics.column_aggregate_metric_provider.ColumnAggregateMetricProvider

Base class for all Column Aggregate Metrics, which define metrics to be calculated in aggregate from a given column.

An example of this is column.mean, which returns the mean of a given column.

Parameters
  • metric_name (str) – A name identifying the metric. Metric Name must be globally unique in a great_expectations installation.

  • domain_keys (tuple) – A tuple of the keys used to determine the domain of the metric.

  • value_keys (tuple) – A tuple of the keys used to determine the value of the metric.

In some cases, subclasses of MetricProvider, such as ColumnAggregateMetricProvider, will already have correct values that may simply be inherited by Metric classes.

-Relevant Documentation Links -

great_expectations.expectations.metrics.column_aggregate_metric_provider.column_aggregate_partial(engine: Type[great_expectations.execution_engine.execution_engine.ExecutionEngine], **kwargs)

Provides engine-specific support for authoring a metric_fn with a simplified signature.

A column_aggregate_partial must provide an aggregate function; it will be executed with the specified engine to provide a value for validation.

A metric function that is decorated as a column_aggregate_partial will be called with the engine-specific column type and any value_kwargs associated with the Metric for which the provider function is being declared.

Parameters
  • engine – The ExecutionEngine used to to evaluate the condition

  • partial_fn_type – The metric function type

  • domain_type – The domain over which the metric will operate

  • **kwargs – Arguments passed to specified function

Returns

An annotated metric_function which will be called with a simplified signature.

great_expectations.expectations.metrics.column_aggregate_metric_provider.column_aggregate_value(engine: Type[great_expectations.execution_engine.execution_engine.ExecutionEngine], **kwargs)

Provides Pandas support for authoring a metric_fn with a simplified signature.

A column_aggregate_value must provide an aggregate function; it will be executed by Pandas to provide a value for validation.

A metric function that is decorated as a column_aggregate_partial will be called with a specified Pandas column and any value_kwargs associated with the Metric for which the provider function is being declared.

Parameters
  • engine – The ExecutionEngine used to to evaluate the condition

  • **kwargs – Arguments passed to specified function

Returns

An annotated metric_function which will be called with a simplified signature.