You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importgreat_expectationsasgxfromprefectimportflowfromprefect_great_expectationsimportrun_checkpoint_validationdefcreate_expectation_suite_and_checkpoint():
"""Create a DataContext, connect to data, create Expectations, create and return a checkpoint."""context=gx.get_context()
validator=context.sources.pandas_default.read_csv(
"https://raw.githubusercontent.com/great-expectations/gx_tutorials/main/data/yellow_tripdata_sample_2019-01.csv"
)
validator.expect_column_values_to_not_be_null("pickup_datetime")
# this expectation will failvalidator.expect_column_values_to_be_between(
"passenger_count", min_value=1, max_value=5
)
# checkpoints are reusble and only need to be created oncecheckpoint=gx.checkpoint.SimpleCheckpoint(
name="taxi_check",
data_context=context,
validator=validator,
)
returncheckpoint@flowdefvalidation_flow(checkpoint):
"""Creates a task that validates a run of a Great Expectations checkpoint"""res=run_checkpoint_validation(checkpoint=checkpoint)
returnif__name__=="__main__":
checkpoint=create_expectation_suite_and_checkpoint()
validation_flow(checkpoint=checkpoint)
Traceback (most recent call last):
File "...", line 1, in <module>
import great_expectations as gx
File "...", line 5, in <module>
from prefect_great_expectations import run_checkpoint_validation
File ".../.venv/lib/python3.9/site-packages/prefect_great_expectations/__init__.py", line 2, in <module>
from .validation import run_checkpoint_validation # noqa
File ".../.venv/lib/python3.9/site-packages/prefect_great_expectations/validation.py", line 6, in <module>
from great_expectations import DataContext
ImportError: cannot import name 'DataContext' from partially initialized module 'great_expectations' (most likely due to a circular import) (...)
The text was updated successfully, but these errors were encountered:
my python file
versions:
great-expectations 0.18.5
prefect-great-expectations 0.2.1
prefect 2.14.11
error:
The text was updated successfully, but these errors were encountered: