Created
July 17, 2023 10:10
-
-
Save OatmealLick/677dbef6ecb5bc6de7b829ce1c20e70e to your computer and use it in GitHub Desktop.
Build data contract (Great) Expectation Suites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _build_data_contract_suites(self, mappings): | |
data_contract_expectation_suites = [] | |
for data_product, tables in mappings.items(): | |
for table in tables: | |
suite = ExpectationSuite( | |
expectation_suite_name=f"{data_product}.data_contract_schema.{table}", | |
meta={ | |
"great_expectations_version": "0.16.11", | |
"critical": True | |
}, | |
expectations=[ | |
ExpectationConfiguration( | |
expectation_type="expect_table_schema_to_match_data_contract_schema", | |
kwargs={ | |
"table_name": table, | |
"data_product": data_product, | |
"env": self.env, | |
"result_format": "COMPLETE" | |
} | |
) | |
] | |
) | |
data_contract_expectation_suites.append(suite) | |
return data_contract_expectation_suites |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment