The documentation is very confusing and could not get a simple suite running #11236
Replies: 2 comments
|
Hi @rvishureddy, sorry for the rough start here — thanks for sticking with it. Two things will most likely unblock you:
A minimal end-to-end version of what you're describing on 1.x looks like: import great_expectations as gx
context = gx.get_context(mode="file")
ds = context.data_sources.add_redshift(
name="redshift_sand",
connection_string="${REDSHIFT_CONNECTION_STRING}",
)
asset = ds.add_table_asset(name="my_table", table_name="my_table")
batch_def = asset.add_batch_definition_whole_table("whole_table")
batch = batch_def.get_batch()
result = batch.validate(
gx.expectations.ExpectColumnValuesToNotBeNull(column="my_column")
)
print(result)
That'll tell us whether it's the API namespace, a missing Redshift driver ( |
0 replies
|
hey @rvishureddy , closing this for now, as this question is over a year old. Sorry it took so long to get you a response - feel free to open another if it's helpful. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
All i am trying to do is run a local test case
Connect to redshift given a database and table name just run if that table has any null values in a particular column or in all columns whichever is easy.
Create a context (My case is everything is local)
Import great_expectations and request a Data Context.
import great_expectations as gx
context = gx.get_context(mode="file")
Optional. Request a File Data Context from a specific folder.
context = gx.get_context(mode="file", project_root_dir="./")
Optional. Review the configuration of the returned File Data Context.
print(context)
Created a file context and added connection string in the config_variable.yml file
Then ran the code given in the connect to sql
import great_expectations as gx
context = gx.get_context()
Set up: Create a Data Source
datasource_name = "redshift_sand"
my_connection_string = "${REDSHIFT_CONNECTION_STRING}"
datasource = context.sources.add_sql(name="redshift_sand", connection_string="${REDSHIFT_CONNECTION_STRING}")
print(context.data_sources.get(datasource_name))
asset_name = ""
asset_table_name = ""
table_asset = datasource.add_table_asset(name=asset_name, table_name=asset_table_name)
The above code gives ton of errors.
All reactions