Connection is unnecessary, GE connects itself.
This commit is contained in:
parent
8cfddbf5d9
commit
9825ab65bd
1 changed files with 3 additions and 5 deletions
|
|
@ -124,18 +124,16 @@ with Flow(...) as flow:
|
||||||
**Run a Great Expectations validation on a MySQL query**
|
**Run a Great Expectations validation on a MySQL query**
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from lolafect.connections import connect_to_mysql
|
|
||||||
from lolafect.data_testing import run_data_test_on_mysql
|
from lolafect.data_testing import run_data_test_on_mysql
|
||||||
|
|
||||||
with Flow(...) as flow:
|
with Flow(...) as flow:
|
||||||
|
|
||||||
a_mysql_connection = connect_to_mysql(...)
|
|
||||||
|
|
||||||
my_query = """SELECT something FROM somewhere"""
|
my_query = """SELECT something FROM somewhere"""
|
||||||
my_expectations = {...} # A bunch of things you want to validate on the result of the query
|
my_expectations = {...} # A bunch of things you want to validate on the result of the query
|
||||||
|
|
||||||
validation_results = run_validation_on_mysql(
|
validation_results = run_validation_on_mysql(
|
||||||
mysql_connection=a_mysql_connection,
|
name="my-cool-validation",
|
||||||
|
mysql_credentials={...},
|
||||||
query=my_query,
|
query=my_query,
|
||||||
expectations=my_expectations
|
expectations=my_expectations
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue