Skip to main content
Version: 0.14.13

Metric Store

SetupArrowConnect to DataArrowCreate ExpectationsArrowValidate Data

Overview

Definition

A Metric Store is a connector to store and retrieve information about computed attributes of data, such as the mean of a column.

Features and promises

The Metric Store differs from an Evaluation Parameter StoreA connector to store and retrieve information about parameters used during Validation of an Expectation which reference simple expressions or previously generated metrics. in how it formats its data. Information stored in a Metric Store is kept in a format that more easily converted into tables which can be used for reports or to analyze trends. It can also be referenced as values for Evaluation ParametersA dynamic value used during Validation of an Expectation which is populated by evaluating simple expressions or by referencing previously generated metrics..

Relationship to other objects

A Metric Store can be referenced by an Expectation SuiteA collection of verifiable assertions about data. to populate values for Evaluation Parameters used by ExpectationsA verifiable assertion about data. within that suite. Metric Stores are also used in CheckpointsThe primary means for validating data in a production deployment of Great Expectations. to store MetricsA computed attribute of data such as the mean of a column. that are included in the Validation ResultsGenerated when data is Validated against an Expectation or Expectation Suite. which are passed to the Checkpoints' action_list.

Use cases

Setup

Setup

If you intend to use a Metric Store, you can configure it in your great_expectations.yml file when you configure other Stores. A Metric Store is an optional addition to great_expectations.yml, and one will not be included by default when you first initialize your Data Context.

For more information, please see our guide on how to configure a Metric Store.

Setup

Create Expectations

When creating Expectations, you can configure them to use your Metric Store to retrieve values for Evaluation Parameters.

Setup

Validate Data

When a Checkpoint is run, it will use a Metric Store to populate values for Evaluation Parameters if the Expectation Suite being run is configured to do so. The StoreMetricsAction Action can also be included in a Checkpoint's action_list. This will cause the Checkpoint to use the Metric Store and store any Metrics that were included in the Validation Results passed to the action_list.

Features

The Metric Store is tailored for storing and retrieving Metrics. Although it can be used within Great Expectations as a reference to populate Evaluation Parameters when an Expectation Suite is run, the fact that it doesn't include other information found in Validation Results means you can also use it to more easily examine trends in your Metrics over time. To help with this, a Metric Store will track the run_id of a Validation and the Expectation Suite name in addition to the metric name and metric kwargs.

API basics

For information on how to create and use a Metric Store, please see our guide on how to configure a Metric Store.