Great Expectations
For Data Quality tests the open source python package Great Expectations stands out from the crowd. For those of you who don’t know, Great Expectations is a shared, open standard for data quality. It helps data teams eliminate pipeline debt, through data testing, documentation, and profiling. Learn more about the product in their documentation. With this tutorial, we show you how to configure Great Expectations to integrate with OpenMetadata and ingest your test results to your table service page.Requirements
OpenMetadata Requirements
You will to have OpenMetadata version 0.12 or later. To deploy OpenMetadata, follow the procedure to Try OpenMetadata in Docker. Before ingesting your tests results from Great Expectations you will need to have your table metadata ingested into OpenMetadata. Follow the instruction in the Connectors section to learn more.Python Requirements
You will need to install our Great Expectations submoduleGreat Expectations Setup
Configure your checkpoint file
Great Expectations integration leverage custom actions. To be able to execute custom actions you will need to run a checkpoint file.action_list section.
Properties:
module_name: this is OpenMetadata submodule nameclass_name: this is the name of the class that will be used to execute the custom actionconfig_file_path: this is the path to yourconfig.yamlfile that holds the configuration of your OpenMetadata serverdatabase_service_name: [Optional] this is an optional parameter. If not specified and 2 tables have the same name in 2 different OpenMetadata services, the custom action will faildatabase_name: [Optional] The database name as it appears in OpenMetadata. For table-based validations (SqlAlchemyDatasourceBatchSpec), this is inferred from the batch spec. Required for query-based or dataframe validations (RuntimeQueryBatchSpec,RuntimeDataBatchSpec) where the table context must be explicitly specified.schema_name: [Optional] The schema name as it appears in OpenMetadata. For table-based validations, this is inferred from the batch spec. Required for query-based or dataframe validations. Defaults to default if not specified.table_name: [Optional] The table name as it appears in OpenMetadata. For table-based validations, this is inferred from the batch spec. Required for query-based or dataframe validations where the table cannot be automatically determined.expectation_suite_table_config_map: [Optional] A dictionary mapping expectation suite names to their target OpenMetadata tables. Required when running multi-table checkpoints, where different expectation suites should send results to different tables. Each entry specifies thedatabase_name,schema_nameandtable_namefor routing validation results.
Multi-Table CheckpointsWhen validating multiple tables in a single checkpoint, use the
expectation_suite_table_config_map parameter to route validation results to the correct OpenMetadata tables. This is necessary because:- Each expectation suite may target a different table
- The checkpoint action needs to know where to send each suite’s results
- Without the mapping, all results would attempt to go to the same default table
users and orders tables with separate expectation suites (users_suite and orders_suite). The expectation_suite_table_config_map ensures users_suite results go to the users table and the orders_suite go to the orders table.For single-table checkpoints, this parameter is not needed - the table information is provided directly or inferred from the batch spec.DataContext instance in Python to run your tests, you can use the run_checkpoint method as follows:
Create your config.yaml file
To ingest Great Expectations results in OpenMetadata, you will need to specify your OpenMetadata security configuration for the REST endpoint. This configuration file needs to be located inside the config_file_path referenced in step 2 and named config.yaml.
{{ env('<MY_ENV_VAR>') }}. These will be parsed and rendered at runtime allowing you to securely create your configuration and commit it to your favorite version control tool. As we support multiple security configurations, you can check out the Enable Security section for more details on how to set the securityConfig part of the yaml file.

Run your Great Expectations Checkpoint File
With everything set up, it is now time to run your checkpoint file.
Running GX using the Python SDK?
If you are running GX using their Python SDK below is a full example of how to add the action to your codeMulti-Table Checkpoint Example
Validate multiple tables in a single checkpoint run:Working with GX 1.x.x?
In v1.x.x GX introduced significant changes to their SDK. One notable change was the removal of thegreat_expectations CLI. OpenMetadata introduced support for 1.x.x version through its OpenMetadataValidationAction1xx class. You will need to first `pip install ‘open-metadata[great-expectations-1xx]’. Below is a complete example