Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions diffly/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,12 @@ def _section_columns(self) -> RenderableType:
"Column", max_width=COLUMN_SECTION_COLUMN_WIDTH, overflow=OVERFLOW
)
matches.add_column("Match Rate", justify="right")
if any(
has_top_changes_column = any(
self.top_k_changes_by_column[col_name] > 0
for col_name in self._comparison._other_common_columns
if self._comparison.fraction_same()[col_name] < 1
):
)
if has_top_changes_column:
matches.add_column("Top Changes", justify="right")
if self.show_perfect_column_matches:
max_col_len = max(
Expand Down Expand Up @@ -635,7 +636,7 @@ def _section_columns(self) -> RenderableType:

matches.add_row(*columns)
if (
top_k_column_changes > 0
has_top_changes_column
or max_col_len > COLUMN_SECTION_COLUMN_WIDTH
):
matches.add_section()
Expand Down
27 changes: 14 additions & 13 deletions docs/guides/features/summary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -77,7 +77,7 @@
"└────────────┴────────────┴──────────┴────────────┴───┴────────────┴──────────┴───────┴────────────┘"
]
},
"execution_count": 19,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -95,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -119,7 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -184,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -247,7 +247,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -324,7 +324,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -362,6 +362,7 @@
" │ │ │ \u001b[33m0.5\u001b[0m -> \u001b[33m1.0\u001b[0m (1x) │\n",
" ├─────────────────┼─────────┼─────────────────────────────────────────────────┤\n",
" │ \u001b[36mloyalty_card_id\u001b[0m │ 90.00% │ │\n",
" ├─────────────────┼─────────┼─────────────────────────────────────────────────┤\n",
" │ \u001b[36mproduct \u001b[0m │ 100.00% │ │\n",
" ├─────────────────┼─────────┼─────────────────────────────────────────────────┤\n",
" │ \u001b[36mquantity \u001b[0m │ 100.00% │ │\n",
Expand Down Expand Up @@ -400,7 +401,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -481,7 +482,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -540,7 +541,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -590,7 +591,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "default",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -604,7 +605,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.2"
"version": "3.14.3"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
▔▔▔▔▔▔▔
┌───────────┬─────────┬──┐
│ speed_kph │ 100.00% │ │
├───────────┼─────────┼──┤
│ weight_kg │ 100.00% │ │
└───────────┴─────────┴──┘
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
▔▔▔▔▔▔▔
┌───────────┬─────────┬──┐
│ speed_kph │ 100.00% │ │
├───────────┼─────────┼──┤
│ weight_kg │ 100.00% │ │
└───────────┴─────────┴──┘

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
▔▔▔▔▔▔▔
┌─────────────────┬─────────┬──┐
│ life_expectancy │ 100.00% │ │
├─────────────────┼─────────┼──┤
│ speed_kph │ 100.00% │ │
├─────────────────┼─────────┼──┤
│ weight_kg │ 100.00% │ │
└─────────────────┴─────────┴──┘
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
▔▔▔▔▔▔▔
┌─────────────────┬─────────┬──┐
│ life_expectancy │ 100.00% │ │
├─────────────────┼─────────┼──┤
│ speed_kph │ 100.00% │ │
├─────────────────┼─────────┼──┤
│ weight_kg │ 100.00% │ │
└─────────────────┴─────────┴──┘

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Diffly Summary ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Primary key: id

Schemas
▔▔▔▔▔▔▔
Schemas match exactly (column count: 4).

Rows
▔▔▔▔
Left count Right count
4 (no change) 4

┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┐
│ amount │ 50.00% │
│ card_id │ 50.00% │
└─────────┴────────┘
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Diffly Summary ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Primary key: id

Schemas
▔▔▔▔▔▔▔
Schemas match exactly (column count: 4).

Rows
▔▔▔▔
Left count Right count
4 (no change) 4

┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┐
│ amount │ 50.00% │
│ card_id │ 50.00% │
└─────────┴────────┘
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Rows
▔▔▔▔
┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┐
│ amount │ 50.00% │
│ card_id │ 50.00% │
└─────────┴────────┘
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Rows
▔▔▔▔
┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┐
│ amount │ 50.00% │
│ card_id │ 50.00% │
└─────────┴────────┘
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Diffly Summary ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Primary key: id

Schemas
▔▔▔▔▔▔▔
Schemas match exactly (column count: 4).

Rows
▔▔▔▔
Left count Right count
4 (no change) 4

┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┬───────────────────┐
│ amount │ 50.00% │ 40.0 -> 45.0 (1x) │
│ │ │ 20.0 -> 25.0 (1x) │
├─────────┼────────┼───────────────────┤
│ card_id │ 50.00% │ "d" -> "D" (1x) │
│ │ │ "b" -> "B" (1x) │
└─────────┴────────┴───────────────────┘
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Diffly Summary ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Primary key: id

Schemas
▔▔▔▔▔▔▔
Schemas match exactly (column count: 4).

Rows
▔▔▔▔
Left count Right count
4 (no change) 4

┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┬───────────────────────────┐
│ amount │ 50.00% │ 40.0 -> 45.0 (1x, e.g. 4) │
│ │ │ 20.0 -> 25.0 (1x, e.g. 2) │
├─────────┼────────┼───────────────────────────┤
│ card_id │ 50.00% │ "d" -> "D" (1x, e.g. 4) │
│ │ │ "b" -> "B" (1x, e.g. 2) │
└─────────┴────────┴───────────────────────────┘
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Rows
▔▔▔▔
┏━┯━┯━┯━┯━┓╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (50.00%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 4 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 2 unequal (50.00%) │
┗━┷━┷━┷━┷━┛╌╌╌┗━┷━┷━┷━┷━┛╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

Columns
▔▔▔▔▔▔▔
┌─────────┬────────┬───────────────────┐
│ amount │ 50.00% │ 40.0 -> 45.0 (1x) │
│ │ │ 20.0 -> 25.0 (1x) │
├─────────┼────────┼───────────────────┤
│ card_id │ 50.00% │ "d" -> "D" (1x) │
│ │ │ "b" -> "B" (1x) │
└─────────┴────────┴───────────────────┘
Loading
Loading