Repository navigation
fix(test): apply tolerance to Variant (object) measure columns - #471
Merged
Merged
Conversation
Measures with the Variant data type read back as "object" columns, which the comparer treated as text: --tolerance and tx: tolerance= were silently ignored, so floating-point noise failed the test. Object cells now compare within the tolerance when both sides parse as numbers and exactly otherwise. --ignore-row-order sorts object columns with the numeric ones, after the dimensions, ranking BLANK, numbers, then text so mixed cells order the same way from any input order.
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.
Summary
Measures with the Variant data type read back from a live model as
objectcolumns (e.g.EVALUATE ROW("Antal timer", [Antal timer])). The comparer applied--tolerance/tx: tolerance=only toint64,doubleanddecimalcolumns, so on these measures the tolerance was ignored without any warning. In a comparison of two live models,3805080.2499999995vs3805080.249999999still failed at--tolerance 0.0001%.objectcells now compare within the tolerance when both sides parse as numbers, and exactly otherwise (text, dates, booleans). BLANK still never matches a number.--ignore-row-ordersortsobjectcolumns by value after the dimension columns. Within a numeric column the order is now BLANK, then numbers by value, then text. The old per-pair fallback to ordinal was cyclic for mixed cells (9 < 10 < "1A" < 9), so the result depended on the input order. Typed numeric columns sort exactly as before.Verified live: the failing fakturering totals test passes after the fix with
--tolerance 0.0001%. The remaining failures in that run are real data differences between the two models.Checklist
docs/commands/updated (if a command, argument, or option changed)CommandSurface.approved.txtregenerated (if the command surface changed): not needed, no surface change[Unreleased]