Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
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
2 changes: 1 addition & 1 deletion data_diff/databases/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def query_table_schema(self, path: DbPath) -> Dict[str, tuple]:
def _process_table_schema(self, path: DbPath, raw_schema: Dict[str, tuple], filter_columns: Sequence[str]):
accept = {i.lower() for i in filter_columns}

col_dict = {name: self._parse_type(path, *row) for name, row in raw_schema.items() if name.lower() in accept}
col_dict = {row[0]: self._parse_type(path, *row) for name, row in raw_schema.items() if name.lower() in accept}

self._refine_coltypes(path, col_dict)

Expand Down
6 changes: 3 additions & 3 deletions data_diff/diff_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class TableSegment:

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

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

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

@property
def _update_column(self):
Expand Down
1 change: 1 addition & 0 deletions data_diff/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def safezip(*args):

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


Expand Down