Skip to content

feat: Add data metrics for numeric columns#46

Open
Moritz Potthoff (MoritzPotthoffQC) wants to merge 27 commits into
mainfrom
more-data-metrics
Open

feat: Add data metrics for numeric columns#46
Moritz Potthoff (MoritzPotthoffQC) wants to merge 27 commits into
mainfrom
more-data-metrics

Conversation

@MoritzPotthoffQC

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

Copy link
Copy Markdown
Contributor

Motivation

Building on #43, we would like to provide a few more "data" metrics, this time for numeric columns only.

Changes

  • Add new data metrics, similar to the change metrics

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: EgeKaraismailogluQC <128645043+EgeKaraismailogluQC@users.noreply.github.com>
…_fraction.py

Co-authored-by: EgeKaraismailogluQC <128645043+EgeKaraismailogluQC@users.noreply.github.com>
Co-authored-by: quant-ranger[bot] <132915763+quant-ranger[bot]@users.noreply.github.com>
Co-authored-by: Marius Merkle <marius.merkle@quantco.com>
Co-authored-by: Marius Merkle <122545105+MariusMerkleQC@users.noreply.github.com>
@codecov

codecov Bot commented Jul 16, 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 (7d2a67f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #46   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         1052      1070   +18     
=========================================
+ Hits          1052      1070   +18     

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

Base automatically changed from generalize-metrics-add-nullability to main July 16, 2026 10:57
@github-actions github-actions Bot added the enhancement New feature or request label Jul 16, 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.

Pull request overview

Adds additional data metrics (computed per-side, then rendered as old -> new (delta)) for numeric columns, and updates summary rendering + golden fixtures to accommodate the expanded metric set.

Changes:

  • Added new data-metric functions (mean_data, median_data, min_data, max_data, std_data) and expanded DEFAULT_DATA_METRICS.
  • Updated summary table rendering to apply consistent overflow handling to metric columns.
  • Updated tests, docs, and regenerated summary fixtures to reflect the new preset metrics/labels and the updated table layout.

Reviewed changes

Copilot reviewed 86 out of 86 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
diffly/metrics/data.py Adds numeric “data” metrics and updates the data-metric presets/utilities.
diffly/summary.py Applies consistent overflow behavior to metric columns in the Columns section.
docs/api/metrics.rst Updates API docs to list the newly added data metrics and renamed null-fraction metric.
tests/test_metrics.py Adds unit tests for new data metrics and renames null-fraction test targets.
tests/cli/test_cli.py Updates CLI metric-selection test to use the new data-metric preset label.
tests/summary/fixtures/metrics_null_fraction/test_metrics_null_fraction.py Updates fixture generator test to use the expanded data-metric preset set.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for new/wrapped metric headers.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for expanded data metrics in the Columns table.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.
tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt Golden fixture updated for wrapped headers with long metric labels.

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

Comment thread diffly/metrics/data.py
Comment thread diffly/metrics/data.py
Comment thread diffly/metrics/data.py
Comment thread diffly/metrics/data.py
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.

2 participants