I followed the Quickstart | Great Expectations
This is the script Iβm using:
"""Install GX
Run the following command in an empty base directory inside a Python virtual environment:
pip install great_expectations
"""
# Run the following Python code to import the great_expectations module
import great_expectations as gx
# Run the following command to create a Data Context object
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"
)
# Run the following commands to create two Expectations and save them to the Expectation Suite
validator.expect_column_values_to_not_be_null("pickup_datetime")
validator.expect_column_values_to_be_between(
"passenger_count", min_value=1, max_value=6
)
validator.save_expectation_suite()
# Run the following command to define a Checkpoint and examine the data to determine if it matches the defined Expectations
checkpoint = context.add_or_update_checkpoint(
name="my_quickstart_checkpoint",
validator=validator,
)
# Run the following command to return the Validation Results
checkpoint_result = checkpoint.run()
# Run the following command to view an HTML representation of the Validation Results in the generated Data Docs
context.view_validation_result(checkpoint_result)
This is the output:
Jorge@DESKTOP-HFQR414 MINGW64 ~/git/great-expectations (main)
$ python app.py
Calculating Metrics: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 6/6 [00:00<00:00, 857.44it/s]
Calculating Metrics: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 8/8 [00:00<00:00, 515.22it/s]
Calculating Metrics: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 15/15 [00:00<00:00, 526.09it/s]
But then it fails to render or open the results page:
I installed jupyter notebooks on my virtual environment (virtualenv) using this command:
python -m pip install jupyter
I tried again to no avail.
Iβm using Python 3.12 on Windows 10 now, but I also tried with python 3.11 and failed just the same.
Do I need macOSX or is GX compatible with windows 10 and Python 3.12?
I donβt know what am I doing wrong.