feat: Expose a user-friendly version of FailureInfo._lf in FailureInfo.details()#275
feat: Expose a user-friendly version of FailureInfo._lf in FailureInfo.details()#275AndreasAlbertQC merged 11 commits intomainfrom
FailureInfo._lf in FailureInfo.details()#275Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR enhances the FailureInfo.invalid() method to return not only the original row data but also additional columns indicating which validation rules failed for each row. The rule columns are converted from boolean values (True/False/None) to user-friendly enum strings ("valid"/"invalid"/"unknown"). This change addresses multiple user requests for better programmatic access to validation failure details.
Changes:
- Modified
FailureInfo.invalid()to include rule validation status columns as enum values instead of only returning original data columns - Fixed pre-existing typo "bedrooom" → "bedroom" in documentation and examples
- Updated existing tests to select only original columns where needed to maintain test assertions
- Added comprehensive test coverage for the new
invalid()output format - Updated documentation with example table showing the new output format
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dataframely/filter_result.py | Core change: modified invalid() to include rule columns as enum values instead of dropping them |
| tests/schema/test_filter.py | Updated existing tests to select specific columns and added new test for the enhanced invalid() output |
| tests/column_types/test_struct.py | Updated tests to select only original columns to maintain existing assertions |
| tests/column_types/test_list.py | Updated test to select only original columns to maintain existing assertions |
| docs/guides/quickstart.md | Fixed typo, added documentation and example table for new invalid() functionality |
| docs/guides/features/serialization.md | Fixed typo in serialization example |
|
docs build appears to be broken independently of this PR, see #276 |
FailureInfo._lf in FailureInfo.invalid()FailureInfo._lf in FailureInfo.violation_details()
FailureInfo._lf in FailureInfo.violation_details()FailureInfo._lf in FailureInfo.details()
Motivation
Addresses #272, #122, #124, #190
Changes
FailureInfo.violation_details, which provides the same rows asFailureInfo.invalidbut also includes rule columns as well as original row values. To make usage easier for users, I decided to cast True/False/None to an enum "valid"/"invalid"/"unknown" (Since I know from personal experience that I often forgot whether "True" means good or bad here)rooomtypo