Skip to content

feat: Allow specifying the floating point precision for percentage outputs - #71

Open
Moritz Potthoff (MoritzPotthoffQC) wants to merge 3 commits into
mainfrom
precision
Open

Moritz Potthoff (MoritzPotthoffQC) wants to merge 3 commits into
mainfrom
precision

Conversation

@MoritzPotthoffQC

@MoritzPotthoffQC Moritz Potthoff (MoritzPotthoffQC) commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (48588c1) to head (ffe36f1).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MoritzPotthoffQC Moritz Potthoff (MoritzPotthoffQC) changed the title feat: Allow specifying the floating point precision in a comparison summary feat: Allow specifying the floating point precision for percentage outputs Oct 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_decimals through 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

Comment thread diffly/cli.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found consistent argument propagation and preserved default behavior with no blocking issues; tests were not executed.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants