feat: add suite_result and tagging #27
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
1. Tagging system
This PR introduces a tagging system for filtering expectations, enabling selective execution based on priority, environment, or custom categories. Tags use
"key:value"format with OR (TagMatchMode.ANY) and AND (TagMatchMode.ALL) matching. The implementation converts core models to Pydantic for type safety, adds theTagMatchModeenum for compile-time validation, and replaces unsafe assertions with production-safe type guards.Examples
Tag expectations:
Filter with OR logic (ANY tag matches):
Filter with AND logic (ALL tags match):
2. Suite Execution Results
The
runner.run()method now supports araise_on_failureparameter (defaultTrue) to control error handling behavior. When set toFalse, it always returns aSuiteExecutionResultobject (whether tests pass or fail) instead of raising exceptions, enabling programmatic inspection of validation outcomes. TheSuiteExecutionResultis a Pydantic model that captures comprehensive execution metadata including applied tag filters, match mode, timing information, pass/fail counts, individual expectation results with violation samples, and dataframe metadata (type, row count, caching status).Example:
Checklist