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

Commit 27a756e

Browse files
authored
Merge pull request #198 from datafold/bugfix_mutual_columns
Bugfix for mutual columns feature (6a4c443)
2 parents 7824b0b + a61961e commit 27a756e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

data_diff/databases/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def query_table_schema(self, path: DbPath) -> Dict[str, tuple]:
192192
def _process_table_schema(self, path: DbPath, raw_schema: Dict[str, tuple], filter_columns: Sequence[str]):
193193
accept = {i.lower() for i in filter_columns}
194194

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

197197
self._refine_coltypes(path, col_dict)
198198

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)