Fix SQL check tolerance for negative expected values#69736
Open
steveahnahn wants to merge 1 commit into
Open
Conversation
steveahnahn
force-pushed
the
fix-sql-check-tolerance-negative-thresholds
branch
from
July 11, 2026 19:02
409be8e to
35e4541
Compare
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.
Split out of #69675 per review feedback there (the change is unrelated to that PR's asset-event topic).
SQLColumnCheckOperator/SQLTableCheckOperatortolerance scaled check bounds by(1 ± tolerance), which moves the bound the wrong way when the expected value is negative: withgeq_to=-1000andtolerance=0.1the bound became-900, so a record equal to the threshold (-1000) failed the check, andequal_to=-100produced an empty acceptance band ([-90, -110]). The fix computes the margin from the magnitude (abs(expected) * tolerance), so tolerance always widens the bound outward. Bounds for positive expected values are unchanged.Adds parametrized regression tests covering negative thresholds for all five comparators, unchanged positive-threshold behavior, and the no-tolerance exact path.
related: #69675
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines