Skip to content

Commit 733db46

Browse files
show summary output, resort features, align data
1 parent bdcaf98 commit 733db46

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ right = pl.DataFrame({
5353
comparison = compare_frames(left, right, primary_key="id")
5454

5555
if not comparison.equal():
56-
print(comparison.summary())
56+
summary = comparison.summary(
57+
top_k_column_changes=1,
58+
show_sample_primary_key_per_change=True
59+
)
60+
print(summary)
5761
```
5862

5963
```

diffly/test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
comparison = compare_frames(left, right, primary_key="id")
1616

1717
if not comparison.equal():
18-
print(comparison.summary(
19-
top_k_column_changes=1, show_sample_primary_key_per_change=True))
18+
summary = comparison.summary(
19+
top_k_column_changes=1,
20+
show_sample_primary_key_per_change=True
21+
)
22+
print(summary)

docs/index.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Diffly is a utility package for comparing Polars DataFrames and LazyFrames with
2222
## Key Features
2323

2424
- **Primary key-based comparison**: Join DataFrames on specified primary keys for row-by-row comparison
25-
- **Tolerance-based equality**: Configure absolute and relative tolerances for floating point comparisons
26-
- **Temporal tolerance**: Support for comparing temporal types (dates, datetimes) with configurable tolerances
2725
- **Rich summaries**: Generate detailed, visually formatted comparison reports
2826
- **Lazy evaluation**: Uses Polars LazyFrames internally for efficient computation
29-
- **Method caching**: Automatically caches comparison results to avoid recomputation
27+
- **Tolerance-based equality**: Configure absolute and relative tolerances for floating point comparisons
28+
- **Temporal tolerance**: Support for comparing temporal types (dates, datetimes) with configurable tolerances
3029
- **Per-column tolerances**: Fine-grained control over comparison tolerances for each column
30+
- **Method caching**: Automatically caches comparison results to avoid recomputation
3131
- **Testing utilities**: Built-in assertion functions for DataFrame and Collection equality in tests
3232

3333
## Quick Example
@@ -40,13 +40,11 @@ from diffly import compare_frames
4040
left = pl.DataFrame({
4141
"id": ["a", "b", "c"],
4242
"value": [1.0, 2.0, 3.0],
43-
"category": ["x", "y", "z"]
4443
})
4544

4645
right = pl.DataFrame({
4746
"id": ["a", "b", "d"],
48-
"value": [1.0, 2.1, 4.0],
49-
"category": ["x", "y", "w"]
47+
"value": [1.0, 2.5, 4.0],
5048
})
5149

5250
# Compare the DataFrames
@@ -56,8 +54,8 @@ comparison = compare_frames(left, right, primary_key="id")
5654
if not comparison.equal():
5755
# Display a detailed summary
5856
summary = comparison.summary(
59-
show_perfect_column_matches=True,
60-
top_k_column_changes=5
57+
top_k_column_changes=1,
58+
show_sample_primary_key_per_change=True
6159
)
6260
print(summary)
6361
```

0 commit comments

Comments
 (0)