great_expectations.expectations.metrics.metric_provider

Module Contents

Classes

MetaMetricProvider()

MetaMetricProvider registers metrics as they are defined.

MetricProvider()

Base class for all metric providers.

Functions

metric_value(engine: Type[ExecutionEngine], metric_fn_type: Union[str, MetricFunctionTypes] = MetricFunctionTypes.VALUE, **kwargs)

The metric decorator annotates a method

metric_partial(engine: Type[ExecutionEngine], partial_fn_type: Union[str, MetricPartialFunctionTypes], domain_type: Union[str, MetricDomainTypes], **kwargs)

The metric decorator annotates a method

great_expectations.expectations.metrics.metric_provider.logger
great_expectations.expectations.metrics.metric_provider.metric_value(engine: Type[ExecutionEngine], metric_fn_type: Union[str, MetricFunctionTypes] = MetricFunctionTypes.VALUE, **kwargs)

The metric decorator annotates a method

great_expectations.expectations.metrics.metric_provider.metric_partial(engine: Type[ExecutionEngine], partial_fn_type: Union[str, MetricPartialFunctionTypes], domain_type: Union[str, MetricDomainTypes], **kwargs)

The metric decorator annotates a method

class great_expectations.expectations.metrics.metric_provider.MetaMetricProvider

Bases: type

MetaMetricProvider registers metrics as they are defined.

class great_expectations.expectations.metrics.metric_provider.MetricProvider

Base class for all metric providers.

MetricProvider classes must have the following attributes set:
  1. metric_name: the name to use. Metric Name must be globally unique in a great_expectations installation.

  1. domain_keys: a tuple of the keys used to determine the domain of the metric

  2. value_keys: a tuple of the keys used to determine the value of the metric.

In some cases, subclasses of Expectation, such as TableMetricProvider will already have correct values that may simply be inherited.

They may optionally override the default_kwarg_values attribute.

MetricProvider classes must implement the following:

1. _get_evaluation_dependencies. Note that often, _get_evaluation_dependencies should augment dependencies provided by a parent class; consider calling super()._get_evaluation_dependencies

In some cases, subclasses of Expectation, such as MapMetricProvider will already have correct implementations that may simply be inherited.

Additionally, they may provide implementations of:

1. Data Docs rendering methods decorated with the @renderer decorator. See the guide “How to create renderers for custom expectations” for more information.

domain_keys
value_keys
default_kwarg_values
classmethod _register_metric_functions(cls)
classmethod get_evaluation_dependencies(cls, metric: MetricConfiguration, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None)

This should return a dictionary:

{

“dependency_name”: MetricConfiguration, …

}

classmethod _get_evaluation_dependencies(cls, metric: MetricConfiguration, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None)