great-expectations
FreeNo executable scriptsNot checkedUse whenever data validation uses Great Expectations (GX Core) on Pandas, SQL or Spark: ExpectationSuites, ValidationDefinitions and Checkpoints, running…
by testland★ 18 GitHub starsAbout this skill
great-expectations
Overview
GX Core is the modern Python library for programmatic data validation workflows. The shape is: DataSource → DataAsset → BatchDefinition → ExpectationSuite → ValidationDefinition → Checkpoint (gx-overview). This skill covers authoring expectations, running them via a ValidationDefinition or Checkpoint, parsing the JSON result, and gating CI on it.
When to use
- The repo imports
great_expectations(Python). - The user asks about
ExpectColumn*,ExpectationSuite,Checkpoint, Data Docs, orgx.get_context(). - A pipeline needs row-level / column-level assertions on Pandas, SQL, or Spark data with a programmatic interface (rather than a YAML-only config like Soda).
- A CI workflow needs to gate a run on a validation result and surface failures in Data Docs or Slack.
Authoring expectations
The four key objects to compose (gx-overview):
- DataSource - represents a connection to a data store (Pandas / SQL / Spark / files).
- DataAsset - a collection of records inside a DataSource (e.g. a table, a directory of partitioned files).
- BatchDefinition - slices a DataAsset into validatable batches (whole table, partition, dataframe).
- ExpectationSuite - a named collection of
Expectationobjects that describe what the data should look like.
Expectations themselves come from the gxe namespace (create-an-expectation):
import great_expectations as gx
from great_expectations import expectations as gxe
context = gx.get_context()
suite = context.suites.add(gx.ExpectationSuite(name="orders_suite"))
# Column-level expectations
suite.add_expectation(gxe.ExpectColumnValuesToNotBeNull(column="order_id"))
suite.add_expectation(gxe.ExpectColumnValuesToBeUnique(column="order_id"))
suite.add_expectation(
gxe.ExpectColumnValuesToBeBetween(
column="discount_percent", min_value=0, max_value=100
)
)
suite.add_expectation(
gxe.ExpectColumnValuesToBeInSet(
column="status",
value_set=["placed", "shipped", "completed", "returned"],
)
)
# Table-level expectations
suite.add_expectation(gxe.ExpectTableRowCountToBeBetween(min_value=1, max_value=10_000_000))
The full expectation gallery (column-, table-, multi-column-, and custom expectations) is browsable at greatexpectations.io/expectations.
Running
Option A - ValidationDefinition (single-suite, single-batch)
A ValidationDefinition binds one BatchDefinition to one
ExpectationSuite. Calling .run() validates and returns a JSON-shaped
result whose results list reports each expectation's outcome
(run-validation-definition):
validation_definition = context.validation_definitions.get("orders_validation")
# batch_parameters maps to the underlying BatchDefinition's keys
result = validation_definition.run(batch_parameters={"year": "2026"})
print(result.success) # bool - True only if every expectation passed
batch_parameters keys depend on how the BatchDefinition was authored:
{"dataframe": df} for a Pandas runtime asset, {"year": "...", "month": "..."} for partitioned data, etc. (run-validation-definition).
Option B - Checkpoint (multi-suite + actions)
A Checkpoint runs one or more ValidationDefinitions and triggers
Actions on the result. Actions live in
great_expectations.checkpoint; built-ins include
UpdateDataDocsAction (regenerates the Data Docs static site) and
SlackNotificationAction (alerts on failure) - all action class names
end with *Action (checkpoint-actions):
import great_expectations as gx
from great_expectations.checkpoint import (
SlackNotificationAction,
UpdateDataDocsAction,
)
context = gx.get_context()
validation_definitions = [context.validation_definitions.get("orders_validation")]
action_list = [
SlackNotificationAction(
name="alert_on_failure",
slack_token="${VALIDATION_SLACK_WEBHOOK}",
slack_channel="${VALIDATION_SLACK_CHANNEL}",
notify_on="failure",
show_failed_expectations=True,
),
UpdateDataDocsAction(name="refresh_data_docs"),
]
checkpoint = gx.Checkpoint(
name="orders_checkpoint",
validation_definitions=validation_definitions,
actions=action_list,
result_format={"result_format": "COMPLETE"},
)
context.checkpoints.add(checkpoint)
checkpoint.run()
result_format controls how much detail the Validation Result carries.
Documented values include SUMMARY (default) and COMPLETE - use
COMPLETE when downstre
Install great-expectations in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the great-expectations skill do?
Use whenever data validation uses Great Expectations (GX Core) on Pandas, SQL or Spark: ExpectationSuites, ValidationDefinitions and Checkpoints, running validations on batches and reading the JSON result to gate CI.
How do I install the great-expectations skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the great-expectations skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic