Repository navigation
feat: Allow specifying the floating point precision for percentage outputs - #71
Open
Moritz Potthoff (MoritzPotthoffQC) wants to merge 3 commits into
Open
Moritz Potthoff (MoritzPotthoffQC) wants to merge 3 commits into
Moritz Potthoff (MoritzPotthoffQC) wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 1140 1144 +4
=========================================
+ Hits 1140 1144 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Negative CLI precision values must be rejected before they cause summary rendering to fail.
1 open issue
What changed in this PR
Adds configurable decimal precision to Diffly’s percentage summaries, allowing users to distinguish near-perfect match rates while preserving the two-decimal default.
Changes:
- Exposes
percentage_decimalsthrough summaries, the CLI, and testing helpers. - Applies the precision to row-count changes, row matches, and column match rates.
- Adds formatting and CLI tests for custom precision.
| File | Description |
|---|---|
| tests/summary/test_summary.py | Tests percentage formatting and summary precision. |
| tests/cli/test_cli.py | Tests the CLI precision option. |
| diffly/testing.py | Forwards precision to assertion summaries. |
| diffly/summary.py | Uses configurable precision when rendering percentages. |
| diffly/comparison.py | Exposes and documents the summary parameter. |
| diffly/cli.py | Adds the --percentage-decimals option. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Moritz Potthoff (MoritzPotthoffQC)
marked this pull request as ready for review
October 23, 2026 22:00
Oliver Borchert (borchero)
approved these changes
Oct 23, 2026
This branch has not been deployed
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.

Motivation
In my use cases, it often makes a big difference if we have 99.991% or 99.99999% match rate. The diffly summaries currently only ever print two decimals. It would be nice to be able to configure the precision.
Changes
Introduce config option across comparison summary, CLI and testing.