Skip to content

Commit 2a3010b

Browse files
feat: Refine summary message for equal empty data frames (#20)
1 parent 70d5369 commit 2a3010b

File tree

33 files changed

+37
-35
lines changed

33 files changed

+37
-35
lines changed

diffly/summary.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ def _print_to_console(self, console: Console) -> None:
146146
self._print_diff(console)
147147

148148
def _print_equal(self, console: Console) -> None:
149-
text = Text(
150-
"--- Data frames match exactly! ---", style="green bold", justify="center"
151-
)
149+
if self._comparison.num_rows_left() == 0:
150+
message = "--- Data frames are empty, but their schema matches exactly! ---"
151+
else:
152+
message = "--- Data frames match exactly! ---"
153+
text = Text(message, style="green bold", justify="center")
152154
text.align("center", console.width)
153155
console.print(text)
154156

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
22
┃ Diffly Summary ┃
33
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
4-
--- Data frames match exactly! ---
4+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
22
┃ Diffly Summary ┃
33
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
4-
--- Data frames match exactly! ---
4+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--- Data frames match exactly! ---
1+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--- Data frames match exactly! ---
1+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
22
┃ Diffly Summary ┃
33
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
4-
--- Data frames match exactly! ---
4+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
22
┃ Diffly Summary ┃
33
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
4-
--- Data frames match exactly! ---
4+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--- Data frames match exactly! ---
1+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--- Data frames match exactly! ---
1+
--- Data frames are empty, but their schema matches exactly! ---
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
22
┃ Diffly Summary ┃
33
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
4-
--- Data frames match exactly! ---
4+
--- Data frames are empty, but their schema matches exactly! ---

0 commit comments

Comments
 (0)