> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Great Expectations

> Learn how to use Great Expectations with Openlayer

<img width="700" style={{ borderRadius: "0.5rem" }} src="https://mintcdn.com/openlayer-44/zlWrng2mbxttdDP9/images/integrations/gx_hero.png?fit=max&auto=format&n=zlWrng2mbxttdDP9&q=85&s=87cc76be103355677a842a2fc5c66601" alt="Great Expectations hero" data-path="images/integrations/gx_hero.png" />

[Great expectations](https://greatexpectations.io/) (GX) is an open-source Python
library that allows you to define and check expectations for your data.

Openlayer integrates with GX and you can use any GX expectation as an Openlayer test.
Refer to the [GX expectations gallery](https://greatexpectations.io/expectations)
to check all the expectations supported.

## Creating GX tests

To create a GX test, click on "Create test" under the "Great expectations" test.

<img width="700" style={{ borderRadius: "0.5rem" }} src="https://mintcdn.com/openlayer-44/xUBIrdsfSKEziWQ7/images/tests/integrity/gx_test.png?fit=max&auto=format&n=xUBIrdsfSKEziWQ7&q=85&s=cadfcb66c3b795cbcfeb8c25758216a9" alt="GX test" data-path="images/tests/integrity/gx_test.png" />

Then, after the modal is open, select the expectation you are interested in from the dropdown.
For example, let's select the `expect_column_mean_to_be_between`.

<img width="700" style={{ borderRadius: "0.5rem" }} src="https://mintcdn.com/openlayer-44/xUBIrdsfSKEziWQ7/images/tests/integrity/gx_selection.png?fit=max&auto=format&n=xUBIrdsfSKEziWQ7&q=85&s=64185f3446bf33d4c0e24d65066f9b77" alt="GX selection" data-path="images/tests/integrity/gx_selection.png" />

Now, you need to provide the arguments required by the expectation. You can click
the link next to "Parameters" to see the documentation for the expectation selected.

In this case, the expectation requires a `column`, with the name of the column,
a `min_value`, and a `max_value`. You can provide these arguments by clicking on "Add kwarg".

<img width="700" style={{ borderRadius: "0.5rem" }} src="https://mintcdn.com/openlayer-44/xUBIrdsfSKEziWQ7/images/tests/integrity/gx_config.png?fit=max&auto=format&n=xUBIrdsfSKEziWQ7&q=85&s=db899617b2d0ace50aec8f257074ed66" alt="GX config" data-path="images/tests/integrity/gx_config.png" />

The "Threshold" should be kept as "Success is True," as the expectation will return `True` if the expectation is met
(in this case, if the column mean is between the `min_value` and the `max_value`).

Once you have added all the arguments, you can click on "Create test" to create the test.

Refer to the [GX expectations gallery](https://greatexpectations.io/expectations)
to check all the expectations supported.
