Skip to content

docs: add Great Expectations validation recipe - #180

Merged
JohnnyWilson16 merged 2 commits into
FreshCode-Org:mainfrom
WilliamK112:agent/great-expectations-recipe
Aug 14, 2026
Merged

docs: add Great Expectations validation recipe#180
JohnnyWilson16 merged 2 commits into
FreshCode-Org:mainfrom
WilliamK112:agent/great-expectations-recipe

Conversation

@WilliamK112

@WilliamK112 WilliamK112 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Add a runnable Great Expectations interoperability recipe that demonstrates a repair-then-validate workflow without adding Great Expectations to FreshData's core dependencies.

The example builds one in-memory GX Core checkpoint, runs it against raw currency and boolean strings (expected to fail), cleans the same DataFrame with fd.clean(), and reruns the checkpoint (expected to pass). It also prints the FreshData repair report so the relationship between repair and validation is explicit.

The recipe is linked from both examples indexes, and the user-facing addition is recorded under Unreleased in the changelog.

Closes #8

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor / Style / Performance improvement

Validation

  • GX_ANALYTICS_ENABLED=false PYTHONPATH=src python examples/10_great_expectations_recipe.py with Great Expectations 1.20.0 (before: failed as expected; after: passed)
  • ruff check .
  • mypy examples/10_great_expectations_recipe.py
  • mkdocs build --strict
  • PYTHONPATH=src pytest -m 'not online and not large' -q (passed; 93.16% coverage)
  • git diff --check

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added executable assertions that prove the before/after behavior
  • New and existing unit tests pass locally with my changes
  • Type checks (mypy) and linter checks (ruff) pass locally

AI Assistance

AI assistance was used to research the current Great Expectations API, draft the example and documentation, and run validation. I reviewed the resulting diff and verified the recipe locally with Great Expectations 1.20.0.

Summary by CodeRabbit

  • New Features

    • Added a runnable Great Expectations recipe demonstrating data repair followed by validation.
    • The example validates raw and cleaned order data, reports results, and confirms expected failure-before/success-after behavior.
    • Great Expectations remains an optional dependency.
  • Documentation

    • Added setup and execution instructions for the new example.
    • Documented checkpoint validation, typed value conversion, cleaning reports, and non-mutating validation behavior.
    • Updated the examples index and changelog with the new recipe.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c73e6c81-a4ca-474d-b588-2599f09c7c41

📥 Commits

Reviewing files that changed from the base of the PR and between 1327de5 and 54e98ac.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • docs/examples.md
  • examples/11_great_expectations_recipe.py
  • examples/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • examples/README.md
  • docs/examples.md
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

Adds an optional Great Expectations recipe that validates raw order data, cleans it with freshdata, validates the cleaned data, and documents installation and execution.

Changes

Great Expectations recipe

Layer / File(s) Summary
Recipe validation flow
examples/11_great_expectations_recipe.py
Adds an executable in-memory checkpoint, validates raw and cleaned DataFrames, runs freshdata.clean, prints results, and asserts failure before cleaning and success after cleaning.
Recipe documentation and release notes
docs/examples.md, examples/README.md, CHANGELOG.md
Documents optional installation, execution, typed value conversion, non-mutating validation, and the repair-then-validate flow. Updates the examples listings and changelog.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 54e98

This change adds an optional Great Expectations validation recipe without altering FreshData’s core dependencies or existing behavior. The documented checks pass, and no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant main
  participant GreatExpectationsCheckpoint
  participant freshdata_clean
  main->>GreatExpectationsCheckpoint: Validate raw DataFrame
  GreatExpectationsCheckpoint-->>main: Validation failure
  main->>freshdata_clean: Clean raw DataFrame
  freshdata_clean-->>main: Return cleaned DataFrame and report
  main->>GreatExpectationsCheckpoint: Validate cleaned DataFrame
  GreatExpectationsCheckpoint-->>main: Validation success
Loading

Possibly related PRs

Suggested reviewers: johnnywilson-portfolio

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a Great Expectations validation recipe.
Description check ✅ Passed The description includes the summary, issue reference, change type, validation details, checklist, and AI assistance disclosure.
Linked Issues check ✅ Passed The recipe, documentation, optional dependency handling, and before/after validation note satisfy issue #8 acceptance criteria.
Out of Scope Changes check ✅ Passed The changes are limited to the optional Great Expectations recipe, related documentation, example indexes, and changelog entry.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

CI note: every check except truthbench has passed. The failing job reports generated_code_sandbox and explicitly classifies it as KNOWN-RED (release-blocking, not a PR regression). This PR changes only the optional GX example and documentation. I attempted to rerun only the failed job, but GitHub restricts reruns to repository maintainers, so a maintainer rerun would be appreciated.

@WilliamK112
WilliamK112 marked this pull request as ready for review August 13, 2026 18:26
@strix-security

Copy link
Copy Markdown
Contributor

Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here.

So far, Strix has reviewed 36 pull requests, surfaced 3 security issues (1 critical/high) and blocked 1 risky merge across this workspace.

@JohnnyWilson16 JohnnyWilson16 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! The repair-then-validate example is clean, well-structured, and keeps Great Expectations nicely decoupled as an optional dependency.

Really appreciate your continuous contributions to FreshData @WilliamK112 — thanks for helping improve the project! 🚀

@JohnnyWilson16
JohnnyWilson16 merged commit f759b7f into FreshCode-Org:main Aug 14, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Great Expectations validation recipe

2 participants