-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Quickstart code under test (#7542)
- Loading branch information
1 parent
dd63701
commit b68fa9a
Showing
5 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
28 changes: 28 additions & 0 deletions
28
tests/integration/docusaurus/tutorials/quickstart/quickstart.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import great_expectations as gx | ||
|
||
# Set up | ||
context = gx.get_context() | ||
|
||
# Connect to data | ||
validator = context.sources.pandas_default.read_csv( | ||
"https://raw.githubusercontent.com/great-expectations/gx_tutorials/main/data/yellow_tripdata_sample_2019-01.csv" | ||
) | ||
|
||
# Create Expectations | ||
validator.expect_column_values_to_not_be_null("pickup_datetime") | ||
validator.expect_column_values_to_be_between("passenger_count", auto=True) | ||
|
||
# Validate data | ||
checkpoint = gx.checkpoint.SimpleCheckpoint( | ||
name="my_quickstart_checkpoint", | ||
data_context=context, | ||
validator=validator, | ||
) | ||
checkpoint_result = checkpoint.run() | ||
|
||
# View results | ||
validation_result_identifier = checkpoint_result.list_validation_result_identifiers()[0] | ||
context.open_data_docs(resource_identifier=validation_result_identifier) | ||
|
||
# Save the Data Context for future use | ||
context.convert_to_file_context() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters