Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e97b755
init
MoritzPotthoffQC Jul 10, 2026
1e72823
better output
MoritzPotthoffQC Jul 10, 2026
1d7bdeb
cleanup
MoritzPotthoffQC Jul 10, 2026
a74429f
refactor
MoritzPotthoffQC Jul 10, 2026
71338c9
Potential fix for pull request finding
MoritzPotthoffQC Jul 10, 2026
cd33f6a
fix
MoritzPotthoffQC Jul 10, 2026
f66bfa0
fix
MoritzPotthoffQC Jul 10, 2026
db3b168
Potential fix for pull request finding
MoritzPotthoffQC Jul 10, 2026
eb1c427
Merge branch 'main' into generalize-metrics-add-nullability
MoritzPotthoffQC Jul 10, 2026
2923f2e
Update docs/api/metrics.rst
MoritzPotthoffQC Jul 12, 2026
e1ea6bd
Update tests/summary/fixtures/metrics_null_fraction/test_metrics_null…
MoritzPotthoffQC Jul 12, 2026
fc0426a
chore: Update pixi lockfile (#42)
quant-ranger[bot] Jul 10, 2026
f5b9117
review
MoritzPotthoffQC Jul 12, 2026
e374f0d
fix
MoritzPotthoffQC Jul 12, 2026
627721e
fix
MoritzPotthoffQC Jul 12, 2026
cf686b4
Merge remote-tracking branch 'origin/main' into generalize-metrics-ad…
MoritzPotthoffQC Jul 13, 2026
529b917
fix
MoritzPotthoffQC Jul 13, 2026
6f5671d
fix
MoritzPotthoffQC Jul 13, 2026
bfc8d8c
fix docs
MoritzPotthoffQC Jul 13, 2026
bfc03ad
fix docs
MoritzPotthoffQC Jul 14, 2026
b309e7a
review
MoritzPotthoffQC Jul 15, 2026
901590c
fix CLI
MoritzPotthoffQC Jul 15, 2026
e35a81e
init
MoritzPotthoffQC Jul 16, 2026
9177c8c
fix
MoritzPotthoffQC Jul 16, 2026
b1c4028
Merge remote-tracking branch 'origin/main' into more-data-metrics
MoritzPotthoffQC Jul 16, 2026
c832e95
improve
MoritzPotthoffQC Jul 16, 2026
7d2a67f
fix overflow
MoritzPotthoffQC Jul 16, 2026
f21a88a
Merge remote-tracking branch 'origin/main' into more-data-metrics
MoritzPotthoffQC Jul 28, 2026
5cd68e1
fix
MoritzPotthoffQC Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions diffly/metrics/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,25 @@ def null_fraction(col: pl.Expr) -> pl.Expr:
formatter=lambda value: f"{round(value * 100, 2)}%",
delta_formatter=lambda value: f"{round(value * 100, 2)}",
),
"Mean": DataMetric(
fn=lambda col: col.mean(),
formatter=lambda value: f"{round(value, 2)}",
selector=cs.numeric(),
),
"Median": DataMetric(
fn=lambda col: col.median(),
formatter=lambda value: f"{round(value, 2)}",
selector=cs.numeric(),
),
"Min": DataMetric(
fn=lambda col: col.min(),
formatter=lambda value: f"{round(value, 2)}",
selector=cs.numeric(),
),
"Max": DataMetric(
fn=lambda col: col.max(),
formatter=lambda value: f"{round(value, 2)}",
selector=cs.numeric(),
),
}
"""Preset metrics describing the left and right datasets individually."""
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@
│ qty │ 80.00% │ 0.2 │ 0 │ 0 │ 1 │ 0.4472 │ 0.2 │ 0.05 │
│ status │ 80.00% │ │ │ │ │ │ │ │
└────────┴────────┴────────┴────────┴─────────┴────────┴─────────┴────────┴─────────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@
│ qty │ 80.00% │ 0.2 │ 0 │ 0 │ 1 │ 0.4472 │ 0.2 │ 0.05 │
│ status │ 80.00% │ │ │ │ │ │ │ │
└────────┴────────┴────────┴────────┴─────────┴────────┴─────────┴────────┴─────────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@
│ qty │ 80.00% │ 0.2 │ 0 │ 0 │ 1 │ 0.4472 │ 0.2 │ 0.05 │
│ status │ 80.00% │ │ │ │ │ │ │ │
└────────┴────────┴────────┴────────┴─────────┴────────┴─────────┴────────┴─────────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@
│ qty │ 80.00% │ 0.2 │ 0 │ 0 │ 1 │ 0.4472 │ 0.2 │ 0.05 │
│ status │ 80.00% │ │ │ │ │ │ │ │
└────────┴────────┴────────┴────────┴─────────┴────────┴─────────┴────────┴─────────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,16 @@
│ │ │ │ │ │ │ │ │ │ "x" │
│ │ │ │ │ │ │ │ │ │ (1x) │
└───────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@
│ │ │ │ │ │ │ │ │ │ e.g. │
│ │ │ │ │ │ │ │ │ │ 3) │
└───────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@
│ │ │ │ │ │ │ │ │ │ "x" │
│ │ │ │ │ │ │ │ │ │ (1x) │
└───────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@
│ │ │ │ │ │ │ │ │ │ e.g. │
│ │ │ │ │ │ │ │ │ │ 3) │
└───────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┴────────┴───────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@
│ qty │ 80.00% │ 0.2 │ 0 │ 0 │ 1 │ 0.4472 │ 0.2 │ 0.05 │
│ status │ 80.00% │ │ │ │ │ │ │ │
└────────┴────────┴────────┴────────┴─────────┴────────┴─────────┴────────┴─────────┘

Data Inspection
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
┏━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Column ┃ Null% ┃ Mean ┃ Median ┃ Min ┃ Max ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ price │ 0.0% -> 0.0% │ 30.0 -> 30.6 │ 30.0 -> 30.0 │ 10.0 -> 10.0 │ 50.0 -> 50.0 │
│ │ (+0.0) │ (+0.6) │ (+0.0) │ (+0.0) │ (+0.0) │
│ qty │ 0.0% -> 0.0% │ 3.0 -> 3.2 │ 3.0 -> 3.0 │ 1 -> 1 (+0) │ 5 -> 5 (+0) │
│ │ (+0.0) │ (+0.2) │ (+0.0) │ │ │
│ status │ 0.0% -> 0.0% │ │ │ │ │
│ │ (+0.0) │ │ │ │ │
└────────┴──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Loading