Skip to content

fix(test): apply tolerance to Variant (object) measure columns - #471

Merged
bgarcevic merged 1 commit into
mainfrom
fix/test-variant-tolerance
Oct 19, 2026
Merged

bgarcevic merged 1 commit into
mainfrom
fix/test-variant-tolerance

Conversation

@bgarcevic

Copy link
Copy Markdown
Owner

Summary

Measures with the Variant data type read back from a live model as object columns (e.g. EVALUATE ROW("Antal timer", [Antal timer])). The comparer applied --tolerance / tx: tolerance= only to int64, double and decimal columns, so on these measures the tolerance was ignored without any warning. In a comparison of two live models, 3805080.2499999995 vs 3805080.249999999 still failed at --tolerance 0.0001%.

  • object cells 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-order sorts object columns 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

  • Tests added or updated for the changed behavior
  • Matching page under docs/commands/ updated (if a command, argument, or option changed)
  • CommandSurface.approved.txt regenerated (if the command surface changed): not needed, no surface change
  • CHANGELOG entry added under [Unreleased]
  • Machine output preserved (JSON field names, exit codes, flag and command names)

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.
@bgarcevic
bgarcevic merged commit e7c8ca2 into main Oct 19, 2026
14 checks passed
@bgarcevic
bgarcevic deleted the fix/test-variant-tolerance branch October 19, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant