Skip to main content
Version: 0.18.21

registry.py

great_expectations.expectations.registry.register_metric(metric_name: str, metric_domain_keys: Tuple[str, ...], metric_value_keys: Tuple[str, ...], execution_engine: Type[ExecutionEngine], metric_class: Type[MetricProvider], metric_provider: Optional[Callable], metric_fn_type: Optional[Union[MetricFunctionTypes, MetricPartialFunctionTypes]] = None) dict

Register a Metric class for use as a callable metric within Expectations.

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

  • metric_domain_keys – A tuple of the keys used to determine the domain of the metric.

  • metric_value_keys – A tuple of the keys used to determine the value of the metric.

  • execution_engine – The execution_engine used to execute the metric.

  • metric_class – A valid Metric class containing logic to compute attributes of data.

  • metric_provider – The MetricProvider class from which the metric_class inherits.

  • metric_fn_type – The MetricFunctionType or MetricPartialFunctionType used to define the Metric class.

Returns

A dictionary containing warnings thrown during registration if applicable, and the success status of registration.