Great Expectations
Great Expectations Integration with ETIQ library details
Last updated
Was this helpful?
Great Expectations Integration with ETIQ library details
Last updated
Was this helpful?
ETIQ adds integration with the OSS library. This allows you to quickly add a suite of tests for your dataset and show the results in the ETIQ dashboard.
The Great Expectations python library needs to be installed if you want to use this functionality;
pip install great_expectations
The library exposes Snapshot.scan_expectations()
through which we can run suites or import existing results. Suites can either come from existing contexts, manually added via code or via JSON.
For the results to be shown in the ETIQ dashboard, you need to run etiq.login()
before starting the scan.
If you've got an existing expectation suite you can pass it that suite as an argument to Snapshot.scan_expectations()
If you've already run the suite, you can just pass those in. This will cause the results to be uploaded into the dashboard;
These expectations are only run when scan_expectations
is called.
Much of the ETIQ library can be driven using a JSON config file. We provide a simple way to specify expectations in this text based format;
The Python code is then just:
scan_expectations
- An Object.
scan_expectations.json_suite
- A list of JSON expectations.
Expectations can be specified in two ways;
If the expectation takes a single argument, then it can just be {<expectation_name>: <argument>}
If the expectation takes more arguments, the argument itself should be an object where each key-value pair represents an argument and value.
The above expectation translates to:
This convenience method returns a validator object for creating expectation suites against.
This is our entry point to run expectations etc. Unless using the JSON method above, you must pass one or more of these arguments in:
validator
- A GX Validator object to run.
context
- A GX context object. This would contain an existing suite to run.
suite_name
- String, name of suite to run from the context
.
results
- Existing results to send to the dashboard.
You can declare your expectations in code directly e.g. as part of a notebook. We supply a helper method Snapshot.get_validator()
to quickly get a Great Expectations .
This will then have all the expectations available to you. The Great Expectations website holds a useful .