v0.3.0
🎯 DataFrame Expectations v0.3.0
⚠️ Breaking Changes
This release introduces a builder pattern for the DataFrameExpectationsSuite that changes how you create and run expectation suites.
Migration Guide:
# Before (v0.2.0)
suite = DataFrameExpectationsSuite()
suite.expect_min_rows(min_rows=3)
suite.run(df)
# After (v0.3.0)
suite = DataFrameExpectationsSuite()
suite.expect_min_rows(min_rows=3)
runner = suite.build() # New: Build a runner
runner.run(df) # Run on the runner✨ New Features
🏗️ Builder Pattern & Immutable Runners
- Introduces
DataFrameExpectationsSuiteRunner- an immutable runner created via.build() - Allows reusing the same validation logic across multiple DataFrames
- Enables building multiple independent runners from the same suite at different stages
🎨 Decorator Pattern for Automatic Validation
Validate DataFrames returned by functions automatically using the @runner.validate decorator:
@runner.validate
def load_data():
return pd.DataFrame({"col": [1, 2, 3]})
# Supports optional DataFrame returns
@runner.validate(allow_none=True)
def maybe_load_data():
if condition:
return pd.DataFrame(...)
return None🔍 Expectation Inspection
- Added
expectation_countproperty to check the number of expectations - Added
list_expectations()method to view all expectations in a runner
📚 Documentation
- Added Spark session initialization to PySpark examples in README and documentation
- Improved example code to be immediately runnable
🔧 Maintenance
- Updated release configuration for simpler tag generation
- Dependency updates: pytest 9.0.0, ruff 0.14.4, pre-commit 4.4.0
📦 What's Changed
- fix: update release please config to generate simple tags by @ryanseq-gyg in #13
- feat!: implement builder pattern for expectation suite runner by @ryanseq-gyg in #18
- build(deps): bump pre-commit from 4.3.0 to 4.4.0 by @dependabot in #17
- build(deps): bump ruff from 0.14.3 to 0.14.4 by @dependabot in #16
- build(deps): bump pytest from 8.4.2 to 9.0.0 in the 01_major-updates group by @dependabot in #15
Full Changelog: v0.2.0...v0.3.0