Fix group rule evaluation order with row-level rules#278
Draft
Fix group rule evaluation order with row-level rules#278
Conversation
- Group rules are now evaluated only on rows that pass row-level rules - This ensures that rows failing row-level rules don't affect group validation - Fixes issue where removing invalid rows could make groups invalid - Added comprehensive tests for the fix Co-authored-by: borchero <22455425+borchero@users.noreply.github.com>
Co-authored-by: borchero <22455425+borchero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix validation result issue with group rules
Fix group rule evaluation order with row-level rules
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Group rules were evaluated on the original dataset before row-level filtering. When a row failing a row-level rule would make a group invalid after removal, the group rule passed incorrectly.
Changes
with_evaluation_rules(): Evaluate row-level rules first, then pass to group rule evaluation_with_group_rules(): Acceptsimple_exprsparameter and filter to rows passing all row-level rules before computing group aggregations. Left join results back to original dataset (rows failing row-level rules get null for group rules, treated as valid).test_filter_group_rule_after_row_rule_filteringcovering interaction scenariosGroup rules now only see data that would remain after row-level filtering.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.