Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit a61961e

Browse files
committed
Better error messages
1 parent 38d5986 commit a61961e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

data_diff/diff_tables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ class TableSegment:
8585

8686
def __post_init__(self):
8787
if not self.update_column and (self.min_update or self.max_update):
88-
raise ValueError("Error: min_update/max_update feature requires to specify 'update_column'")
88+
raise ValueError("Error: the min_update/max_update feature requires 'update_column' to be set.")
8989

9090
if self.min_key is not None and self.max_key is not None and self.min_key >= self.max_key:
91-
raise ValueError("Error: min_key expected to be smaller than max_key!")
91+
raise ValueError(f"Error: min_key expected to be smaller than max_key! ({self.min_key} >= {self.max_key})")
9292

9393
if self.min_update is not None and self.max_update is not None and self.min_update >= self.max_update:
94-
raise ValueError("Error: min_update expected to be smaller than max_update!")
94+
raise ValueError(f"Error: min_update expected to be smaller than max_update! ({self.min_update} >= {self.max_update})")
9595

9696
@property
9797
def _update_column(self):

data_diff/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def safezip(*args):
1818

1919
def split_space(start, end, count):
2020
size = end - start
21+
assert count <= size, (count, size)
2122
return list(range(start, end, (size + 1) // (count + 1)))[1 : count + 1]
2223

2324

0 commit comments

Comments
 (0)