Skip to content

feat!: Introduce new summary section for data metrics - #47

Merged
Moritz Potthoff (MoritzPotthoffQC) merged 42 commits into
mainfrom
data-inspection-section
Jul 28, 2026
Merged

feat!: Introduce new summary section for data metrics#47
Moritz Potthoff (MoritzPotthoffQC) merged 42 commits into
mainfrom
data-inspection-section

Conversation

@MoritzPotthoffQC

@MoritzPotthoffQC Moritz Potthoff (MoritzPotthoffQC) commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Motivation

See this discussion: We want to display data metrics in their own section in the summary.

Changes

  • Add differentiation for the metrics
  • Add new section Data Inspection that gets all the data metrics

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

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (01cef28) to head (6a09e68).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #47   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        13    -1     
  Lines         1052      1127   +75     
=========================================
+ Hits          1052      1127   +75     

☔ 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.

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.

Pull request overview

This PR extends Diffly’s summary reporting to distinguish change metrics (computed over deltas) from data inspection metrics (describing left/right datasets), and renders the latter in a new dedicated “Data Inspection” section while also separating them in the JSON schema.

Changes:

  • Add Metric.kind ("change" vs "data") and mark the Null% preset as a "data" metric.
  • Split per-column metric outputs into metrics vs data_metrics in the summary JSON, and render "data" metrics in a new “Data Inspection” section.
  • Update summary tests and regenerate pretty-output fixtures to reflect the new section/layout.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
diffly/metrics/_common.py Adds Metric.kind to classify metrics by rendering section.
diffly/metrics/data.py Marks Null% preset as a "data" metric.
diffly/summary.py Routes metric labels into change vs data lists; adds “Data Inspection” rendering and JSON schema changes.
tests/summary/test_summary.py Adds coverage for metrics vs data_metrics JSON routing; updates expected JSON shape.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt Updates fixture output to move Null% into “Data Inspection”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread diffly/summary.py Outdated

@EgeKaraismailogluQC EgeKaraismailogluQC left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you Moritz Potthoff (@MoritzPotthoffQC)! In general I am happy with the layout. I added a few comments. In addition to those, I think it would be nice to have at least one summary fixture where we render two or more data metrics rather than just one, just to see what that looks like (maybe I missed it?).

Comment thread diffly/summary.py Outdated
Comment thread diffly/metrics/_common.py Outdated
Comment thread diffly/metrics/_common.py Outdated
Comment thread diffly/metrics/data.py Outdated
@MoritzPotthoffQC
Moritz Potthoff (MoritzPotthoffQC) marked this pull request as draft July 22, 2026 17:29

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.

Pull request overview

Copilot reviewed 51 out of 52 changed files in this pull request and generated 1 comment.

Comment thread diffly/metrics/__init__.py Outdated

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.

Pull request overview

Copilot reviewed 84 out of 85 changed files in this pull request and generated 2 comments.

Comment thread diffly/comparison.py Outdated
Comment thread docs/api/metrics.rst
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

@EgeKaraismailogluQC EgeKaraismailogluQC left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great, thank you Moritz Potthoff (@MoritzPotthoffQC)! There is a final issue with codecov. That can sometimes be a false positive and then would go away upon retrigger. Can you take a look? Otherwise, LGTM 😄

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for working on the metrics in this and other PRs. I didn't review 100% of the changes in depth and trust EgeKaraismailogluQC's review for it. Just a few comments from my side.

Comment thread diffly/metrics/__init__.py Outdated
Comment thread diffly/metrics/change.py Outdated
Comment thread tests/summary/test_summary.py Outdated
Comment thread diffly/comparison.py Outdated

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.

Pull request overview

Copilot reviewed 85 out of 86 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, looks great now!

Comment thread diffly/comparison.py
Comment thread docs/guides/features/summary.ipynb Outdated
Comment thread diffly/summary.py
Comment thread tests/summary/fixtures/metrics_long_labels/test_metrics_long_labels.py Outdated
Comment thread tests/summary/fixtures/metrics_presets_few/test_metrics_presets_few.py Outdated
Comment thread tests/summary/test_summary.py Outdated
Comment thread tests/summary/test_summary.py Outdated
Comment thread tests/summary/test_summary.py Outdated
Comment thread tests/test_metrics.py Outdated
Comment thread docs/api/metrics.rst Outdated
@MoritzPotthoffQC
Moritz Potthoff (MoritzPotthoffQC) merged commit a626117 into main Jul 28, 2026
18 checks passed
@MoritzPotthoffQC
Moritz Potthoff (MoritzPotthoffQC) deleted the data-inspection-section branch July 28, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants