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

Commit 6a2c3ec

Browse files
committed
Fix types; Fix test for presto
1 parent e65dede commit 6a2c3ec

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

data_diff/table_segment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ def count_and_checksum(self) -> Tuple[int, int]:
243243
assert checksum, (count, checksum)
244244
return count or 0, int(checksum) if count else None
245245

246-
def query_key_range(self) -> Tuple[int, int]:
246+
def query_key_range(self) -> Tuple[tuple, tuple]:
247247
"""Query database for minimum and maximum key. This is used for setting the initial bounds."""
248248
# Normalizes the result (needed for UUIDs) after the min/max computation
249249
select = self.make_select().select(
250250
ApplyFuncAndNormalizeAsString(this[k], f) for k in self.key_columns for f in (min_, max_)
251251
)
252-
result = self.database.query(select, tuple)
252+
result = tuple(self.database.query(select, tuple))
253253

254254
if any(i is None for i in result):
255255
raise ValueError("Table appears to be empty")

tests/test_diff_tables.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -880,13 +880,14 @@ class TestCompoundKeyAlphanum(DiffTestCase):
880880
def setUp(self):
881881
super().setUp()
882882

883-
diffs = [(uuid.uuid1(i), str(i), str(i)) for i in range(100)]
883+
rows = [(uuid.uuid1(i), i, str(i)) for i in range(100)]
884+
rows2 = list(rows)
885+
x = rows2[9]
886+
rows2[9] = (x[0], 9000, x[2])
884887
self.connection.query(
885888
[
886-
self.src_table.insert_rows(diffs),
887-
commit,
888-
self.dst_table.insert_expr(self.src_table),
889-
code("UPDATE {tbl} SET id2 = 9000 WHERE id2 = 9", tbl=self.dst_table),
889+
self.src_table.insert_rows(rows),
890+
self.dst_table.insert_rows(rows2),
890891
commit,
891892
]
892893
)

0 commit comments

Comments
 (0)